Comments (5)
Hi, friend, I don't know what you mean? Could you talk more in detail?
from yolov5-lite.
After training completion, figure of Recall, Precision, and F1 are generated. Now, how to generate the txt file for Recall vs Confidence, Precision vs Confidence, and F1 vs Confidence?
from yolov5-lite.
Actually, you can draw and save txt files by using test.py
The code to save the txt file is as follows:
# Append to text file
if save_txt:
gn = torch.tensor(shapes[si][0])[[1, 0, 1, 0]] # normalization gain whwh
for *xyxy, conf, cls in predn.tolist():
xywh = (xyxy2xywh(torch.tensor(xyxy).view(1, 4)) / gn).view(-1).tolist() # normalized xywh
line = (cls, *xywh, conf) if save_conf else (cls, *xywh) # label format
with open(save_dir / 'labels' / (path.stem + '.txt'), 'a') as f:
f.write(('%g ' * len(line)).rstrip() % line + '\n')
Please remember to set python test.py --save-txt
When you use it
from yolov5-lite.
not this.. i mean in the metrics.py file..
def plot_mc_curve(px, py, save_dir='mc_curve.png', names=(), xlabel='Confidence', ylabel='Metric'):
# Metric-confidence curve
fig, ax = plt.subplots(1, 1, figsize=(9, 6), tight_layout=True)
if 0 < len(names) < 21: # display per-class legend if < 21 classes
for i, y in enumerate(py):
ax.plot(px, y, linewidth=1, label=f'{names[i]}') # plot(confidence, metric)
else:
ax.plot(px, py.T, linewidth=1, color='grey') # plot(confidence, metric)
y = py.mean(0)
ax.plot(px, y, linewidth=3, color='blue', label=f'all classes {y.max():.2f} at {px[y.argmax()]:.3f}')
ax.set_xlabel(xlabel)
ax.set_ylabel(ylabel)
ax.set_xlim(0, 1)
ax.set_ylim(0, 1)
plt.legend(bbox_to_anchor=(1.04, 1), loc="upper left")
fig.savefig(Path(save_dir), dpi=250)
i added the line below but not working
np.savetxt(Path(names + '.txt'), np.column_stack([px,y]))
from yolov5-lite.
i mean how to obtain it in txt file apart from the figure plot
from yolov5-lite.
Related Issues (20)
- Deploy TensorRT C++ in Jetson_Xaviver NX
- 训练结果为nan
- wrong parameters in train.py
- 请问一下这些模型都是在多少epochs情况下训练得到的? HOT 2
- 为什么我用lite5e 测出来计算量是2.5Gflops而不是0.7 HOT 2
- onnxruntime cpp demo 输出的box坐标为负的 HOT 2
- 使用推理时,遇到了问题 HOT 1
- yolov5_7.0版本经过rep_convert.py脚本转换后,推理报错。 HOT 2
- 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了,如何解决?
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.