Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.
This repository was archived by the owner on Aug 11, 2023. It is now read-only.

Object detection using YOLO on Edge TPU #86

Description

@eunjins

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.

$ python3 examples/detect_image.py \
  --model test_data/yolov4-tiny-relu-new_coords-int8_edgetpu.tflite \
  --labels test_data/coco_labels.txt \
  --input test_data/grace_hopper.bmp

----INFERENCE TIME----
Note: The first inference is slow because it includes loading the model into Edge TPU memory.
Traceback (most recent call last):
  File "examples/detect_image.py", line 108, in <module>
    main()
  File "examples/detect_image.py", line 87, in main
    objs = detect.get_objects(interpreter, args.threshold, scale)
  File "/usr/lib/python3/dist-packages/pycoral/adapters/detect.py", line 191, in get_objects
    scores = common.output_tensor(interpreter, 2)[0]
  File "/usr/lib/python3/dist-packages/pycoral/adapters/common.py", line 29, in output_tensor
    return interpreter.tensor(interpreter.get_output_details()[i]['index'])()
IndexError: list index out of range

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions