generalize webcam detection with opt.source.isnumeric() (yolov3 #1462)
This commit is contained in:
1 parent
09402a2174
commit
82ed33a052
2 files changed
+2
-2
No files matched your search
@@ -21,7 +21,7 @@ from utils.torch_utils import select_device, load_classifier, time_synchronized
|
||||
def detect(save_img=False):
|
||||
out, source, weights, view_img, save_txt, imgsz = \
|
||||
opt.output, opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size
|
||||
webcam = source == '0' or source.startswith('rtsp') or source.startswith('http') or source.endswith('.txt')
|
||||
webcam = source.isnumeric() or source.startswith('rtsp') or source.startswith('http') or source.endswith('.txt')
|
||||
|
||||
# Initialize
|
||||
set_logging()
|
||||
|
||||
Reference in new issue
Block a user