Comments (4)
@davidemerolla hello!
Great to hear that your YOLOv8n model is performing well! To change the class names for inference without retraining, you can simply modify the names
list in the *.yaml
file that corresponds to your model's classes. This file is used during inference to map class IDs to class names. Just update the names there, and your best.pt
model will output the new class names during inference.
Regarding using your best.pt
file with the Ultralytics HUB app, you can upload your model and the modified *.yaml
file directly to the app. The HUB Docs provide detailed instructions on how to do this.
If you have any further questions or need more assistance, feel free to ask. Happy inferencing! 😊
from hub.
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
For additional resources and information, please see the links below:
- Docs: https://docs.ultralytics.com
- HUB: https://hub.ultralytics.com
- Community: https://community.ultralytics.com
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐
from hub.
Hello! You can rename a class in this way.
import torch
from ultralytics import YOLO
model = torch.load("best.pt", map_location="cpu")
model["model"].names[0] = "New name"
torch.save(model, "save_best.pt")
model = YOLO(r"save_best.pt")
print(model.names)
https://github.com/BitCode-in/rename_torch_or_yolov_names/tree/main
from hub.
@BitCode-in hello! While the code snippet you shared outlines a method to rename class names in a PyTorch model file, it's important to note that directly manipulating .pt
files should be done with caution and understanding of the model structure. Also, we typically recommend making name changes in the *.yaml
file for simplicity and to avoid potential issues with model integrity.
However, your approach provides an alternative for those comfortable with PyTorch and direct model manipulation. Just be sure to verify the model's performance and output accuracy after such changes.
Happy to see community members sharing their solutions! If there's anything specific you're trying to achieve or any further questions, feel free to ask. 🌟
from hub.
Related Issues (20)
- "The dataset images cannot be located" from annotated dataset using Roboflow. HOT 2
- Mr HOT 2
- Problem resuming training in Google Colab HOT 3
- Ultra2Seg HOT 1
- Using Ultralytics SAHI Tiled Inference in Ultralytics Hub HOT 2
- Problem resuming training in Google Colab (Continued) HOT 8
- @sergiuwaxmann @glenn-jocher could you please explain why your system is deducting 2 bills for single model training ?? HOT 2
- Unable to login using Apple Sign In HOT 5
- Fail to train model through HUB HOT 6
- How to train my images using the android mobile version of YOLOV8 model HOT 1
- Train two models using Ultralytics cloud in Pro mode HOT 4
- YAML file creation HOT 2
- Problem with uploading Pose dataset HOT 9
- After Model training on HUB, while testing model getting below error HOT 17
- Different predict result from preview and my app for same image HOT 6
- pavement distress detection HOT 3
- Can't see the output result HOT 2
- Not able to export the model for Android or iOS and also not able to test by uploading any image or capture with camera HOT 14
- Can not get my storage back HOT 7
- Nguyen9789 HOT 2
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 hub.