Comments (1)
目前没有直接保存成json文件的脚本,但是YOLOv5的作者写了保存成txt文件的功能,你在预测时请添加--save-txt=true
或者如果你更想直接一些,可以在utils/plot.py文件中的以下代码:
def plot_one_box(x, img, color=None, label=None, line_thickness=3):
# Plots one bounding box on image img
tl = line_thickness or round(0.002 * (img.shape[0] + img.shape[1]) / 2) + 1 # line/font thickness
color = color or [random.randint(0, 255) for _ in range(3)]
c1, c2 = (int(x[0]), int(x[1])), (int(x[2]), int(x[3]))
cv2.rectangle(img, c1, c2, color, thickness=tl, lineType=cv2.LINE_AA)
if label:
tf = max(tl - 1, 1) # font thickness
t_size = cv2.getTextSize(label, 0, fontScale=tl / 3, thickness=tf)[0]
c2 = c1[0] + t_size[0], c1[1] - t_size[1] - 3
cv2.rectangle(img, c1, c2, color, -1, cv2.LINE_AA) # filled
cv2.putText(img, label, (c1[0], c1[1] - 2), 0, tl / 3, [225, 255, 255], thickness=tf, lineType=cv2.LINE_AA)
调出int(x[0]), int(x[1])), (int(x[2]), int(x[3])的四个坐标,方便自己封在json文件中
from yolov5-lite.
Related Issues (20)
- AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor' when export to onnx HOT 3
- ./v5lite_trt ./config.yaml ./samples/ terminate called after throwing an instance of 'YAML::TypedBadConversion<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >' what(): bad conversion
- lite-e我训练时发现GFLOPS是2.7 HOT 1
- shufflenetv2预训练的模型的问题 HOT 1
- v5lite android中如何将显示在OpenCV的推理结果输出到java中
- Exception: [34m[1mtrain: [0mError loading data from data//VOC/images/train/: [34m[1mtrain: [0mdata/VOC/images/train does not exist See https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data
- 为什么YOLOv5-Lite的推理会比YOLOv5n的推理速度要慢? HOT 2
- 训练新的模型 HOT 1
- train的时候调用test发生ValueError: not enough values to unpack (expected 3, got 2)报错 HOT 3
- How to Transfer Learning with yolov5 lite HOT 1
- find_blob_index_by_name Reshape_output_0 failed HOT 3
- 请教大佬个问题,推理文件夹时,崩溃。engine->getNbBindings()的值等于4了,如何解决?
- pt > ncnn 的文档帮更新下呗
- Will int8 support provided in existing export.py for converting model into int8.tflite?
- cpp_demo中mnn框架部署yolov5-lite导致系统内存一直被占用问题的说明及解决办法 HOT 2
- onnx export with NMS does not work.
- v5lite-g.pt 部署至rk3588 預測結果錯誤 HOT 2
- heatmap功能报错 HOT 2
- 树莓派5B MNN 部署yolov5lite运行过程中出现异常,报错double free or corruption (out)
- None of the models support dynamic batch size
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov5-lite.