Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyAB committed Apr 28, 2020
1 parent 65506eb commit 6d38218
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build/darknet/x64/darknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def detect_image(net, meta, im, thresh=.5, hier_thresh=.5, nms=.45, debug= False
metaMain = None
altNames = None

def performDetect(imagePath="data/dog.jpg", thresh= 0.25, configPath = "./cfg/yolov3.cfg", weightPath = "yolov3.weights", metaPath= "./cfg/coco.data", showImage= True, makeImageOnly = False, initOnly= False):
def performDetect(imagePath="data/dog.jpg", thresh= 0.25, configPath = "./cfg/yolov4.cfg", weightPath = "yolov4.weights", metaPath= "./cfg/coco.data", showImage= True, makeImageOnly = False, initOnly= False):
"""
Convenience function to handle the detection and returns of objects.
Expand Down Expand Up @@ -456,7 +456,7 @@ def performDetect(imagePath="data/dog.jpg", thresh= 0.25, configPath = "./cfg/yo
print("Unable to show image: "+str(e))
return detections

def performBatchDetect(thresh= 0.25, configPath = "./cfg/yolov3.cfg", weightPath = "yolov3.weights", metaPath= "./cfg/coco.data", hier_thresh=.5, nms=.45, batch_size=3):
def performBatchDetect(thresh= 0.25, configPath = "./cfg/yolov4.cfg", weightPath = "yolov4.weights", metaPath= "./cfg/coco.data", hier_thresh=.5, nms=.45, batch_size=3):
import cv2
import numpy as np
# NB! Image sizes should be the same
Expand Down
4 changes: 2 additions & 2 deletions build/darknet/x64/darknet_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def cvDrawBoxes(detections, img):
def YOLO():

global metaMain, netMain, altNames
configPath = "./cfg/yolov3.cfg"
weightPath = "./yolov3.weights"
configPath = "./cfg/yolov4.cfg"
weightPath = "./yolov4.weights"
metaPath = "./cfg/coco.data"
if not os.path.exists(configPath):
raise ValueError("Invalid config path `" +
Expand Down
4 changes: 2 additions & 2 deletions darknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def detect_image(net, meta, im, thresh=.5, hier_thresh=.5, nms=.45, debug= False
metaMain = None
altNames = None

def performDetect(imagePath="data/dog.jpg", thresh= 0.25, configPath = "./cfg/yolov3.cfg", weightPath = "yolov3.weights", metaPath= "./cfg/coco.data", showImage= True, makeImageOnly = False, initOnly= False):
def performDetect(imagePath="data/dog.jpg", thresh= 0.25, configPath = "./cfg/yolov4.cfg", weightPath = "yolov4.weights", metaPath= "./cfg/coco.data", showImage= True, makeImageOnly = False, initOnly= False):
"""
Convenience function to handle the detection and returns of objects.
Expand Down Expand Up @@ -456,7 +456,7 @@ def performDetect(imagePath="data/dog.jpg", thresh= 0.25, configPath = "./cfg/yo
print("Unable to show image: "+str(e))
return detections

def performBatchDetect(thresh= 0.25, configPath = "./cfg/yolov3.cfg", weightPath = "yolov3.weights", metaPath= "./cfg/coco.data", hier_thresh=.5, nms=.45, batch_size=3):
def performBatchDetect(thresh= 0.25, configPath = "./cfg/yolov4.cfg", weightPath = "yolov4.weights", metaPath= "./cfg/coco.data", hier_thresh=.5, nms=.45, batch_size=3):
import cv2
import numpy as np
# NB! Image sizes should be the same
Expand Down
4 changes: 2 additions & 2 deletions darknet_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def cvDrawBoxes(detections, img):
def YOLO():

global metaMain, netMain, altNames
configPath = "./cfg/yolov3.cfg"
weightPath = "./yolov3.weights"
configPath = "./cfg/yolov4.cfg"
weightPath = "./yolov4.weights"
metaPath = "./cfg/coco.data"
if not os.path.exists(configPath):
raise ValueError("Invalid config path `" +
Expand Down
2 changes: 2 additions & 0 deletions src/activations.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ float gradient(float x, ACTIVATION a)
return loggy_gradient(x);
case RELU:
return relu_gradient(x);
case RELU6:
return relu6_gradient(x);
case NORM_CHAN:
//return relu_gradient(x);
case NORM_CHAN_SOFTMAX_MAXVAL:
Expand Down

0 comments on commit 6d38218

Please sign in to comment.