when running the following code:
“”"
for image_file in image_files:
detect_and_draw_box(image_file)
“”"
the following error occurred.
Downloading yolov3-tiny.cfg from https://github.com/pjreddie/darknet/raw/master/cfg/yolov3-tiny.cfg
Could not establish connection. Download failed
Downloading yolov3_classes.txt from https://github.com/arunponnusamy/object-detection-opencv/raw/master/yolov3.txt
Could not establish connection. Download failed
FileNotFoundError Traceback (most recent call last)
in
1 for image_file in image_files:
----> 2 detect_and_draw_box(image_file)
in detect_and_draw_box(filename, model, confidence)
20
21 # Perform the object detection
—> 22 bbox, label, conf = cv.detect_common_objects(img, confidence=confidence, model=model)
23
24 # Print current image’s filename
~/anaconda3/envs/mlep-w1-lab/lib/python3.7/site-packages/cvlib/object_detection.py in detect_common_objects(image, confidence, nms_thresh, model, enable_gpu)
92
93 if initialize:
—> 94 classes = populate_class_labels()
95 net = cv2.dnn.readNet(weights_file_abs_path, config_file_abs_path)
96 initialize = False
~/anaconda3/envs/mlep-w1-lab/lib/python3.7/site-packages/cvlib/object_detection.py in populate_class_labels()
17 if not os.path.exists(class_file_abs_path):
18 download_file(url=url, file_name=class_file_name, dest_dir=dest_dir)
—> 19 f = open(class_file_abs_path, ‘r’)
20 classes = [line.strip() for line in f.readlines()]
21
FileNotFoundError: [Errno 2] No such file or directory: ‘/Users/myusername/.cvlib/object_detection/yolo/yolov3/yolov3_classes.txt’