Hardware Platform (Tesla T4 16 GB)**
DeepStream Version 7.1
TensorRT Version 10.7.0.23-1+cuda12.6
NVIDIA GPU Driver Version 550.127.05
Hi , I Trained my Custom 3 class classification Model on YOLO11. i have best.pt which i want to use as a SGIE but when i export it into engine file from this code…
from ultralytics import YOLO
model = YOLO(“best.pt”)
model.export(format=“engine”)
and i use that engine file then i got an error (“Segmentation fault (core dumped)”)
can anyone please guide me , how to convert best.pt into engine file with all detailed steps?
DeepStream only support ONNX model now. Please export your model as ONNX model.
Yes but if i converts my Model into onnx with
from ultralytics import YOLO
model = YOLO(“best.pt”)
model.export(format=“onnx”) then it shows label_id of classifier always 0 , No matter which class is predicted.
suppose my classes are 0 : Black , 1: Green ,2: Red then it’ll predict Label_id : 0 and Label_name : Red!!
also it is showing only 1 Output on output.mp4
Suppose i have a car detection model and i’m using my custom colour classification model of yolo11 right? then it’ll only show output of classifier on only few cars.
How did you verify the model works?
it should show either one label on each detected object. for now it only show SGIE output on only few objects and also it should print Different label id for different label names
Have you verified before you deploy the model with DeepStream? How did you verified the model?
i tested my model with
from ultralytics import YOLO
model = YOLO(‘best.pt’)
Source = “image_c1.jpg”
results = model.predict(Source , show = False , save = True , conf = 0.5)
and it was showing all three classes.
even i tested ONNX model too, it was showing all three classes too.
Then how did you deploy the model with DeepStream?
as i mentioned in 1st Message , i converted my model into engine file with
from ultralytics import YOLO
model = YOLO(“best.pt”)
model.export(format=“engine”)
it’ll create onnx and engine file both and then i deployed it on deepstream
Please use TensorRT to convert the engine file. Or the DeepStream can deploy ONNX model directly. What is your preprocessing and postprocessing configurations with this model in DeepStream?
Yes i did that thing too , i gave only onnx file into the SGIE1_config.txt but then it showing results only on few detected objects with same label id for all classes.
Here is the example how i linked all elements.
source.link(h264parser)
h264parser.link(decoder)
sinkpad = streammux.get_request_pad(“sink_0”)
srcpad = decoder.get_static_pad(“src”)
srcpad.link(sinkpad)
streammux.link(pgie)
pgie.link(tracker)
tracker.link(sgie1)
sgie1.link(nvosd)
# nvvidconv.link(nvosd)
nvosd.link(enc)
enc.link(h264parser_out)
h264parser_out.link(mp4mux)
mp4mux.link(sink)
Please check whether the DeepStream preprocess and postprocess configuration is aligned to ultralytics. The inferencing parameters should be aligned with the training parameters.
is there any example of SGIE with YOLO’s classification model? or SGIE’s config file with Custom YOLO’s classification model?
No DeepStream sample for YOLO classification model now. You just need to figure out the preprocessing and postprocessing algorithm from the ultralytics code first.
okay I’ll try. Thank you for your response ! 😊
There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks