Open akamal816 opened 1 year ago
To output the pixel coordinates of the bounding box vertices, add --save-txt
when running detect.py
. After that, you can calculate the rotation angle of the bounding box.
you can find out angle by this adding this line after --save-txt you file a text file cross every lable so 1 to 9 are four points of detected object
Hello guys, I loaded model from local directory. I want to get angle from result model trained. My code: "
import torch import numpy as np import cv2
model = torch.hub.load('PJ1/yolov5_obb', 'custom',source='local',path='PJ1/result_2--0.3c/best.pt', force_reload=True) image = cv2.imread("/home/lenovo/Documents/TRAIN/PJ1/images/HH_Rotate_0_0_1.jpg")
results = model(image) detections = results.poly[0] print(detections)" error: YOLOv5 🚀 b00c3f2 torch 1.10.1+cu113 CUDA:0 (NVIDIA Quadro M1000M, 2002MiB)
Fusing layers...
Model Summary: 290 layers, 21584355 parameters, 0 gradients, 50.2 GFLOPs
Adding AutoShape...
Traceback (most recent call last):
File "/home/lenovo/Documents/TRAIN/PJ1/ex_2.py", line 11, in
Hello All
After running
detect.py
is there anyway to output the pixel coordinates of the bounding box vertices and the rotation angle of the bounding box as well?Thank you!