-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C# #631
Comments
👋 Hello @Googlikhail, thank you for raising an issue about Ultralytics HUB 🚀! Please visit our HUB Docs to learn more:
If this is a 🐛 Bug Report, please provide screenshots and steps to reproduce your problem to help us get started working on a fix. If this is a ❓ Question, please provide as much information as possible, including dataset, model, environment details etc. so that we might provide the most helpful response. We try to respond to all issues as promptly as possible. Thank you for your patience! |
@Googlikhail hello! 👋 It looks like your question revolves around the correct way to pre-process an image in C# for use with a YOLO model. From your code snippet and description of the issue, it seems like the image scaling and formatting might not be correctly matched with what the model expects. Here are a few things to consider:
Since your case involves C#, aligning your preprocessing steps with these considerations might require specific adjustments based on the libraries (Emgu.CV and Microsoft.ML.Transforms.Onnx) you're using. Consider revisiting step 3, related to the extraction and normalization of pixel values, ensuring that any necessary normalization is applied correctly according to your model's training. Unfortunately, without diving deeper into the specifics of the ONNX model you are using and the exact preprocessing steps it was trained with, these suggestions are somewhat general. For more detailed guidance on preprocessing requirements for YOLO models and other specifics, the Ultralytics HUB Docs might offer additional insights: https://docs.ultralytics.com/hub. Hope this helps! If you have more questions or need further clarification, feel free to ask. |
👋 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:
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 ⭐ |
Search before asking
Question
Hello, can you tell me how to properly pre-process a photo in C#? I have a webcam detection project and I use the NuGet packages Emgu.CV and Microsoft.ML.Transforms.Onnx. I made a code to test it on the image, but I saw that the model made the wrong output and built something like a “ladder” of detection squares, just like in the output version for the webcam project. There is very little information regarding new versions of yolo and C# and I hope for your help. After trying different options for correcting the error, I came to the conclusion that the model is receiving incorrectly preprocessed images - that’s why I’m asking a question regarding preprocessing.
`using System;
using System.Drawing;
using System.IO;
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
using Microsoft.ML;
using Microsoft.ML.Data;
using Microsoft.ML.Transforms.Onnx;
public class Program
{
static void Main(string[] args)
{
// Creating an ML.NET context
var mlContext = new MLContext();
}
public class ImageData
{
public byte[] Image { get; set; }
public string ImagePath { get; set; }
}
public class OnnxPrediction
![6IqQGmH7BU8](https://private-user-images.githubusercontent.com/125526547/320922158-2385da8c-dfd0-4005-aa2f-b0e979cfece2.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNTI3MDcsIm5iZiI6MTcyMDI1MjQwNywicGF0aCI6Ii8xMjU1MjY1NDcvMzIwOTIyMTU4LTIzODVkYThjLWRmZDAtNDAwNS1hYTJmLWIwZTk3OWNmZWNlMi5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNlQwNzUzMjdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05NTFlNjE0MTYyMTUxZDIwYTAwMDE1ZjVlODFjY2M2ZWI4NWZmZWVlNzBmNjFjMzM5ZTE0OWU0NzMyNTZmZDhlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.AJPyKyOfmQKT5RU4AdOxdCdavSQyAKFrEsqGdBUB6tE)
{
[ColumnName("output0")]
public float[] PredictedLabels { get; set; }
}`
Additional
No response
The text was updated successfully, but these errors were encountered: