Comments (1)
Hello @majnas,
Thank you for reaching out and providing a detailed description of your issue along with the relevant code snippets and images. It’s great to see the effort you’ve put into troubleshooting and documenting your problem.
To help you effectively, let's address a few key points:
-
Reproducible Example: Could you please provide a minimal reproducible example of your issue? This will help us replicate the problem on our end and investigate it further. You can refer to our minimum reproducible example guide for more details on what to include.
-
Package Versions: Ensure that you are using the latest versions of
torch
andultralytics
. You can upgrade your packages using the following commands:pip install --upgrade torch ultralytics
-
Segmentation Label Format: Your approach to converting masks to YOLO segmentation format seems correct. However, the discrepancy you observed during training might be due to the resampling of segments. The line you mentioned:
segments = np.stack(resample_segments(segments, n=segment_resamples), axis=0)
is intended to resample the points in the segments to a fixed number, which might be causing the issue. By changing it to:
segments = np.stack(segments, axis=0)
you are bypassing the resampling, which seems to resolve the issue for you. This suggests that the resampling process might be altering the segment points in a way that affects the mask.
-
Code for Loading Text Files: The relevant part of the code that handles loading and processing the segmentation text files can be found in the
ultralytics/data/dataset.py
file. Specifically, theload_segments
function is responsible for reading the segmentation data from the text files. -
Training Command: Your training command looks correct. However, if you continue to face issues, you might want to experiment with different augmentation parameters or try training on a smaller subset of your dataset to isolate the problem.
Here’s a simplified example of how you might structure your dataset and training script:
# Example of dataset.yaml
path: /path/to/dataset
train: images/train
val: images/val
test: images/test
# Number of classes
nc: 1
# Class names
names: ['road']
# Training command
yolo segment train model=yolov9c-seg.pt epochs=10 imgsz=640 data=/path/to/dataset.yaml batch=3 scale=0.0 translate=0.0 fliplr=0.0 mosaic=0.0 device="cpu"
If you have any further questions or need additional assistance, please feel free to ask. We’re here to help! 😊
from ultralytics.
Related Issues (20)
- YOLOv8 resizes input images differently when training for classification? HOT 3
- FedAvg with YOLO HOT 6
- YOLOv8, v10, RT-DETR albumentation do not apply HOT 5
- How can i train better my project ? YOLOV8 HOT 14
- Codebase for running YoloV10 with ONNX HOT 8
- xywh returns wrong result while xyxy returns right result HOT 1
- Support distributed evaluation during training process HOT 1
- Is there an example of yolov8n-segn Android split HOT 2
- @glenn-jocher tracker is not working for custom trained models,
- multi input video to YOLOv8 and using bytetrack.yaml return same ID to different object and keep increasing HOT 2
- The engine model RTX3060 exported by RTX4070 cannot be inferred HOT 3
- YOLO(model_yaml).load(model.pt) not work. HOT 5
- Exporting after training on YoloV10 raise a ValueError with MultiGPU HOT 7
- Yolov8 classifier training: impossible to disable some augmentation options HOT 5
- Decoupled Head in YOLOv8 HOT 5
- How to increase the weight of segmentation loss in a segmentation task? HOT 11
- Why is the performance of detection task better than segmentation task? HOT 9
- Permission Denied Error in the middle/end of training. HOT 5
- Show the true label HOT 1
- The confidence difference of pt and onnx model on yolov9. HOT 3
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 ultralytics.