updates
This commit is contained in:
parent
dfa999455f
commit
d70ceec22a
|
@ -51,7 +51,7 @@ def detect(cfg,
|
||||||
return
|
return
|
||||||
|
|
||||||
# Half precision
|
# Half precision
|
||||||
opt.half = opt.half and device.type != 'cpu' # half precision only supported on cuda
|
opt.half = opt.half and device.type != 'cpu' # half precision only supported on CUDA
|
||||||
if opt.half:
|
if opt.half:
|
||||||
model.half()
|
model.half()
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,13 @@ class LoadWebcam: # for inference
|
||||||
pipe = 0 # local camera
|
pipe = 0 # local camera
|
||||||
# pipe = 'rtsp://192.168.1.64/1' # IP camera
|
# pipe = 'rtsp://192.168.1.64/1' # IP camera
|
||||||
# pipe = 'rtsp://username:password@192.168.1.64/1' # IP camera with login
|
# pipe = 'rtsp://username:password@192.168.1.64/1' # IP camera with login
|
||||||
# pipe = '"rtspsrc location="rtsp://username:password@192.168.1.64/1" latency=10 ! appsink' # GStreamer https://answers.opencv.org/question/215996/changing-gstreamer-pipeline-to-opencv-in-pythonsolved/
|
|
||||||
|
# https://answers.opencv.org/question/215996/changing-gstreamer-pipeline-to-opencv-in-pythonsolved/
|
||||||
|
# pipe = '"rtspsrc location="rtsp://username:password@192.168.1.64/1" latency=10 ! appsink' # GStreamer
|
||||||
|
|
||||||
|
# https://answers.opencv.org/question/200787/video-acceleration-gstremer-pipeline-in-videocapture/
|
||||||
|
# https://stackoverflow.com/questions/54095699/install-gstreamer-support-for-opencv-python-package # install help
|
||||||
|
# pipe = "rtspsrc location=rtsp://root:root@192.168.0.91:554/axis-media/media.amp?videocodec=h264&resolution=3840x2160 protocols=GST_RTSP_LOWER_TRANS_TCP ! rtph264depay ! queue ! vaapih264dec ! videoconvert ! appsink" # GStreamer
|
||||||
|
|
||||||
self.cap = cv2.VideoCapture(pipe) # video capture object
|
self.cap = cv2.VideoCapture(pipe) # video capture object
|
||||||
|
|
||||||
|
|
|
@ -624,14 +624,14 @@ def print_mutation(hyp, results, bucket=''):
|
||||||
|
|
||||||
if bucket:
|
if bucket:
|
||||||
os.system('gsutil cp gs://%s/evolve.txt .' % bucket) # download evolve.txt
|
os.system('gsutil cp gs://%s/evolve.txt .' % bucket) # download evolve.txt
|
||||||
|
|
||||||
with open('evolve.txt', 'a') as f: # append result
|
with open('evolve.txt', 'a') as f: # append result
|
||||||
f.write(c + b + '\n')
|
f.write(c + b + '\n')
|
||||||
x = np.unique(np.loadtxt('evolve.txt', ndmin=2), axis=0) # load unique rows
|
x = np.unique(np.loadtxt('evolve.txt', ndmin=2), axis=0) # load unique rows
|
||||||
np.savetxt('evolve.txt', x[np.argsort(-fitness(x))], '%11.3g') # save sort by fitness
|
np.savetxt('evolve.txt', x[np.argsort(-fitness(x))], '%11.3g') # save sort by fitness
|
||||||
|
|
||||||
|
if bucket:
|
||||||
os.system('gsutil cp evolve.txt gs://%s' % bucket) # upload evolve.txt
|
os.system('gsutil cp evolve.txt gs://%s' % bucket) # upload evolve.txt
|
||||||
else:
|
|
||||||
with open('evolve.txt', 'a') as f:
|
|
||||||
f.write(c + b + '\n')
|
|
||||||
|
|
||||||
|
|
||||||
def fitness(x):
|
def fitness(x):
|
||||||
|
|
Loading…
Reference in New Issue