pull/5400/head
AlexeyAB 5 years ago
parent 65506eb04a
commit 6d38218a04
  1. 4
      build/darknet/x64/darknet.py
  2. 4
      build/darknet/x64/darknet_video.py
  3. 4
      darknet.py
  4. 4
      darknet_video.py
  5. 2
      src/activations.c

@ -313,7 +313,7 @@ netMain = None
metaMain = None metaMain = None
altNames = 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. 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)) print("Unable to show image: "+str(e))
return detections 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 cv2
import numpy as np import numpy as np
# NB! Image sizes should be the same # NB! Image sizes should be the same

@ -42,8 +42,8 @@ altNames = None
def YOLO(): def YOLO():
global metaMain, netMain, altNames global metaMain, netMain, altNames
configPath = "./cfg/yolov3.cfg" configPath = "./cfg/yolov4.cfg"
weightPath = "./yolov3.weights" weightPath = "./yolov4.weights"
metaPath = "./cfg/coco.data" metaPath = "./cfg/coco.data"
if not os.path.exists(configPath): if not os.path.exists(configPath):
raise ValueError("Invalid config path `" + raise ValueError("Invalid config path `" +

@ -313,7 +313,7 @@ netMain = None
metaMain = None metaMain = None
altNames = 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. 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)) print("Unable to show image: "+str(e))
return detections 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 cv2
import numpy as np import numpy as np
# NB! Image sizes should be the same # NB! Image sizes should be the same

@ -42,8 +42,8 @@ altNames = None
def YOLO(): def YOLO():
global metaMain, netMain, altNames global metaMain, netMain, altNames
configPath = "./cfg/yolov3.cfg" configPath = "./cfg/yolov4.cfg"
weightPath = "./yolov3.weights" weightPath = "./yolov4.weights"
metaPath = "./cfg/coco.data" metaPath = "./cfg/coco.data"
if not os.path.exists(configPath): if not os.path.exists(configPath):
raise ValueError("Invalid config path `" + raise ValueError("Invalid config path `" +

@ -293,6 +293,8 @@ float gradient(float x, ACTIVATION a)
return loggy_gradient(x); return loggy_gradient(x);
case RELU: case RELU:
return relu_gradient(x); return relu_gradient(x);
case RELU6:
return relu6_gradient(x);
case NORM_CHAN: case NORM_CHAN:
//return relu_gradient(x); //return relu_gradient(x);
case NORM_CHAN_SOFTMAX_MAXVAL: case NORM_CHAN_SOFTMAX_MAXVAL:

Loading…
Cancel
Save