How to get the coordinates of the bounding box in YOLOv4?
Closed this issue · 3 comments
Markmichelin commented
Sorry i want to know How to get the coordinates of the bounding box in YOLOv4? thanks
hhk7734 commented
tensorflow-yolov4/py_src/yolov4/tf/__init__.py
Lines 105 to 131 in 3d31292
tensorflow-yolov4/py_src/yolov4/common/base_class.py
Lines 152 to 156 in 3d31292
Put an image in predict()
. Then, you can get the bbox.
Markmichelin commented
Sorry i want to run in v2.1.0 what can i do ?
hhk7734 commented
https://wiki.loliot.net/docs/lang/python/libraries/yolov4/python-yolov4-about#tensorflow
from yolov4.tf import YOLOv4
yolo = YOLOv4()
# yolo = YOLOv4(tiny=True)
yolo.classes = "coco.names"
yolo.input_size = (640, 480)
yolo.make_model()
yolo.load_weights("yolov4.weights", weights_type="yolo")
# yolo.load_weights("yolov4-tiny.weights", weights_type="yolo")
frame = cv2.imread(media_path)
frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
bboxes = self.predict(frame_rgb)