From 6d38218a046995b789fdc8afbf09b73e4432f9ac Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Tue, 28 Apr 2020 19:20:22 +0300 Subject: [PATCH] Minor fix --- build/darknet/x64/darknet.py | 4 ++-- build/darknet/x64/darknet_video.py | 4 ++-- darknet.py | 4 ++-- darknet_video.py | 4 ++-- src/activations.c | 2 ++ 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/build/darknet/x64/darknet.py b/build/darknet/x64/darknet.py index ee561dac..27a7a679 100644 --- a/build/darknet/x64/darknet.py +++ b/build/darknet/x64/darknet.py @@ -313,7 +313,7 @@ netMain = None 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. @@ -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 diff --git a/build/darknet/x64/darknet_video.py b/build/darknet/x64/darknet_video.py index a5e462fc..aa9c6696 100644 --- a/build/darknet/x64/darknet_video.py +++ b/build/darknet/x64/darknet_video.py @@ -42,8 +42,8 @@ altNames = None 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 `" + diff --git a/darknet.py b/darknet.py index ee561dac..27a7a679 100644 --- a/darknet.py +++ b/darknet.py @@ -313,7 +313,7 @@ netMain = None 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. @@ -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 diff --git a/darknet_video.py b/darknet_video.py index a5e462fc..aa9c6696 100644 --- a/darknet_video.py +++ b/darknet_video.py @@ -42,8 +42,8 @@ altNames = None 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 `" + diff --git a/src/activations.c b/src/activations.c index dac252b6..1a76433a 100644 --- a/src/activations.c +++ b/src/activations.c @@ -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: