-
Notifications
You must be signed in to change notification settings - Fork 75
Object detection using YOLO on Edge TPU #86
Comments
@eunjins how can i get prediction results of my image. I mean the [x,y,w,h,cof,cls] |
Hello @Fetulhak bboxes = yolo.predict(frame,prob_thresh=prob_thresh) bboxes will be an array where each element having 6 parameters |
Thanks. |
@eunjins at the baseclass here https://github.com/hhk7734/tensorflow-yolov4/blob/master/py_src/yolov4/common/base_class.py the predict class is defined like this
isn't is 6 things should it return like you explain it above but from the return value it is only five |
Check this file |
@Fetulhak tensorflow-yolov4/py_src/yolov4/tflite/__init__.py Lines 131 to 140 in 3d31292
|
This is realy interesting. Would you share your tflite file? |
@hhk7734 Here is the tflite file. |
@Fetulhak @JayantGoel001 |
@eunjins https://wiki.loliot.net/docs/lang/python/libraries/yolov4/python-yolov4-edge-tpu#run-example-script |
@hhk7734 |
@hhk7734 when i use "pip install -U yolov4" in google colab it only mount the "py_src/yolov4" part of the github. how to pip install the whole github directory so that we can access the "coco.names" under test folder and the whole project as it is in the github |
@hhk7734 @eunjins @JayantGoel001 when I run the demo on the documentation after pip install yolov4 import cv2 from yolov4.tf import YOLOv4 yolo = YOLOv4() yolo.config.parse_names("coco.names") yolo.make_model() yolo.inference(media_path="kite.jpg") yolo.inference(media_path="road.mp4", is_image=False) yolo.inference( I have the following error: /usr/local/lib/python3.7/dist-packages/yolov4/common/parser.py in parse_names(names_path) FileNotFoundError: [Errno 2] No such file or directory: 'coco.names' |
Now I solve the errno 2 problem by mounting my drive to google colab and putting those three files "cco.names", "yolov4-tiny.cfg" , "yolov4-tiny.weights" and "kite.gpg" in my drive and giving that directory for the inference() function here is the sample code any one who gets into the same trouble import cv2 from yolov4.tf import YOLOv4 yolo = YOLOv4() yolo.config.parse_names("/content/drive/MyDrive/coco.names") yolo.make_model() Okay there is another error this time. the problem now is the inference function definition>>>which brings me back to my previous question #86 (comment) which is the predict function inside base class here is how inference function is defined
my question now is isn't it self.predict going to call the predict function in the base class which is wrongly defined????? |
Hi @Fetulhak Or the best thing you can do is try, debug and run till you fully understand the working of yolov4-tf.🙂 |
For this query instead of installing yolov4, you can clone this repo in your colab. |
Hi,
I want to run this code.
detect_image.py
The original recommendation is the ssd-mobilenet model, but I put the yolov4-tiny model I compiled.
I compiled tflite with Edge TPU compiler like this. (Classification works fine for this model, only object detection doesn't work.)
My colab
I can't find what the problem is. Is the model compilation wrong? Or do I need another code?
Thanks
The text was updated successfully, but these errors were encountered: