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

Description
Hi, thanks for your wonderful work. However, I have got very different results from cpu and edgetpu. In the following image, left one is the result using cpu, and the right one is the result using edgetpu.

These are the scripts I've used:
- convert weight to tflite and quantize:
from yolov4.tf import YOLOv4, YOLODataset, save_as_tflite
yolo = YOLOv4()
yolo.config.parse_names("test/coco.names")
yolo.config.parse_cfg("config/yolov4-tiny-relu-tpu.cfg")
yolo.make_model()
yolo.load_weights(
"/home/hhk7734/NN/yolov4-tiny-relu.weights", weights_type="yolo"
)
dataset = YOLODataset(
config=yolo.config,
dataset_list="/home/hhk7734/NN/val2017.txt",
image_path_prefix="/home/hhk7734/NN/val2017",
training=False,
)
save_as_tflite(
model=yolo.model,
tflite_path="yolov4-tiny-relu-int8.tflite",
quantization="full_int8",
dataset=dataset,
)
-
convert to edgetpu model:
edgetpu_compiler -sa yolov4-tiny-relu-int8.tflite
-
inference on cpu:
import cv2
from yolov4.tflite import YOLOv4
yolo = YOLOv4()
yolo.config.parse_names("test/coco.names")
yolo.config.parse_cfg("config/yolov4-tiny-relu-tpu.cfg")
yolo.summary()
yolo.load_tflite("yolov4-tiny-relu-int8.tflite")
yolo.inference("test/kite.jpg")
- inference on edgetpu:
import cv2
from yolov4.tflite import YOLOv4
yolo = YOLOv4()
yolo.config.parse_names("test/coco.names")
yolo.config.parse_cfg("config/yolov4-tiny-relu-tpu.cfg")
yolo.summary()
yolo.load_tflite("yolov4-tiny-relu-int8_edgetpu.tflite")
yolo.inference("test/kite.jpg")