Example of usage cv2.imread() in the darknet.py

This commit is contained in:
AlexeyAB 2018-05-17 23:26:55 +03:00
parent 71437a936d
commit 24f563ce71
3 changed files with 10 additions and 4 deletions

View File

@ -222,9 +222,11 @@ def detect(net, meta, image, thresh=.5, hier_thresh=.5, nms=.45, debug= False):
""" """
#pylint: disable= C0321 #pylint: disable= C0321
im = load_image(image, 0, 0) im = load_image(image, 0, 0)
#import cv2
#custom_image = cv2.imread(image) # use: detect(,,imagePath,)
#import scipy.misc #import scipy.misc
#sci_image = scipy.misc.imread(image) #custom_image = scipy.misc.imread(image)
#im, arr = array_to_image(sci_image) # you should comment line below: free_image(im) #im, arr = array_to_image(custom_image) # you should comment line below: free_image(im)
if debug: print("Loaded image") if debug: print("Loaded image")
num = c_int(0) num = c_int(0)
if debug: print("Assigned num") if debug: print("Assigned num")

View File

@ -2,6 +2,7 @@ rem download Python 2.7.14 from: https://www.python.org/downloads/release/python
rem C:\Python27\Scripts\pip install numpy rem C:\Python27\Scripts\pip install numpy
rem C:\Python27\Scripts\pip install scikit-image rem C:\Python27\Scripts\pip install scikit-image
rem C:\Python27\Scripts\pip install scipy rem C:\Python27\Scripts\pip install scipy
rem C:\Python27\Scripts\pip install opencv-python
C:\Python27\python.exe darknet.py C:\Python27\python.exe darknet.py
@ -11,6 +12,7 @@ rem Python 3.6
rem C:\Users\Alex\AppData\Local\Programs\Python\Python36\Scripts\pip install numpy rem C:\Users\Alex\AppData\Local\Programs\Python\Python36\Scripts\pip install numpy
rem C:\Users\Alex\AppData\Local\Programs\Python\Python36\Scripts\pip install scikit-image rem C:\Users\Alex\AppData\Local\Programs\Python\Python36\Scripts\pip install scikit-image
rem C:\Users\Alex\AppData\Local\Programs\Python\Python36\Scripts\pip install scipy rem C:\Users\Alex\AppData\Local\Programs\Python\Python36\Scripts\pip install scipy
rem C:\Users\Alex\AppData\Local\Programs\Python\Python36\Scripts\pip install opencv-python
rem C:\Users\Alex\AppData\Local\Programs\Python\Python36\python.exe darknet.py rem C:\Users\Alex\AppData\Local\Programs\Python\Python36\python.exe darknet.py

View File

@ -222,9 +222,11 @@ def detect(net, meta, image, thresh=.5, hier_thresh=.5, nms=.45, debug= False):
""" """
#pylint: disable= C0321 #pylint: disable= C0321
im = load_image(image, 0, 0) im = load_image(image, 0, 0)
#import cv2
#custom_image = cv2.imread(image) # use: detect(,,imagePath,)
#import scipy.misc #import scipy.misc
#sci_image = scipy.misc.imread(image) #custom_image = scipy.misc.imread(image)
#im, arr = array_to_image(sci_image) # you should comment line below: free_image(im) #im, arr = array_to_image(custom_image) # you should comment line below: free_image(im)
if debug: print("Loaded image") if debug: print("Loaded image")
num = c_int(0) num = c_int(0)
if debug: print("Assigned num") if debug: print("Assigned num")