GithubHelp home page GithubHelp logo

Comments (1)

glenn-jocher avatar glenn-jocher commented on July 24, 2024

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:

  1. 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.

  2. Package Versions: Ensure that you are using the latest versions of torch and ultralytics. You can upgrade your packages using the following commands:

    pip install --upgrade torch ultralytics
  3. 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.

  4. 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, the load_segments function is responsible for reading the segmentation data from the text files.

  5. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.