Click here to Skip to main content
16,022,339 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
New to object detection in C#.

These were the steps to train my model.

!nvidia-smi
!pip install ultralytics
!pwd

import os
HOME = os.getcwd()
print(HOME)

from ultralytics import YOLO
from IPython.display import display, Image
from IPython import display
display.clear_output()
!yolo checks                               ... instead of !yolo mode=checks (warning error)



# roboflow copy project details
!pip install roboflow

from roboflow import Roboflow
rf = Roboflow(api_key="....")
project = rf.workspace("fcuv4h").project("test0xi")
version = project.version(1)
dataset = version.download("yolov8")



!yolo task=detect mode=train model=yolov8s.pt data={dataset.location}/data.yaml epochs=20 imgsz=640 



Now I downloaded the best.pt weight, but how should this custom weights be used in C#. Do these need to be converted to onnx format and what is best way to convert?

After if conversion is done what steps should be taken.

What any article or link to follow to complete inference in winform webcam c#.

What I have tried:

Already converted to onnx model but with help of chat gpt tried to inference but did not work.
Posted

1 solution

A simple Google search finds a library that appears to do exactly what you want.GitHub - sstainba/Yolov8.Net: A .net 6 implementation to use Yolov5 and Yolov8 models via the ONNX Runtime[^]

The example at the bottom of the readme.MD file addresses loading from an onnx file, so it should be of help to you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900