Giter VIP home page Giter VIP logo

Comments (8)

github-actions avatar github-actions commented on May 26, 2024

πŸ‘‹ Hello @zqstdy, thank you for your interest in Ultralytics YOLOv8 πŸš€! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a πŸ› Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

from ultralytics.

glenn-jocher avatar glenn-jocher commented on May 26, 2024

@zqstdy hello! Thanks for reaching out and detailing the issue you encountered with the single-channel input setup. From what you have described and the screenshots, it seems like there might be something specific about the configuration causing this problem.

Could you please share the configuration snippet you used, especially around input resolutions and channel settings? Also, enabling channels for one might require checking the compatibility of subsequent layers or operations specific to single-channel data. Here's a brief example of how you set the channels to 1 in your data configuration file:

# Inside the YAML data configuration file
nc: 1  # number of channels

Furthermore, ensure your preprocessing steps, if any, are converting images to grayscale correctly (assuming you are using grayscale images for a 1-channel model). For now, verifying your data preprocessing steps and the configuration snippet would be helpful to further diagnose this.

Looking forward to your response!

from ultralytics.

zqstdy avatar zqstdy commented on May 26, 2024

A grayscale image with a size of 640 * 640
image
Then I want to train the model as a single channel grayscale image, rather than a three channel BGR
Can we currently achieve such a demand?

from ultralytics.

glenn-jocher avatar glenn-jocher commented on May 26, 2024

Hello! Yes, you can train a YOLOv8 model with single-channel grayscale images. Make sure your dataset images are properly converted to grayscale and that your model configuration is set to handle one channel.

In your data.yaml, set the number of channels like this:

nc: 1  # number of channels

And ensure your preprocessing converts images to grayscale. If using custom data loading or preprocessing scripts, here’s a simple way to convert an image to grayscale with OpenCV:

import cv2
image = cv2.imread('path_to_image')
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

This should help you set up training for single-channel images! Let us know if you have more questions. 😊

from ultralytics.

zqstdy avatar zqstdy commented on May 26, 2024

First of all, thank you for your reply
nc: 1
As far as I know, the number of categories is set, and the number of channels cannot be changed

image

ch: 1
The number of channels can be changed, but training will report an error

image

I hope to use single channel training to improve the inference efficiency of the model

You can do some related testing, but I haven't found any code for single channel processing in the source code yet

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.