YOLONAS cant detect a video

162 views Asked by At

I want to use yolonas small version for object detection in my project, I already train the model with 20 epochs, when i try predict a image with this code :

from super_gradients.training import models

dataset_params = {
    'classes': ['fire', 'smoke', 'others']
}

best_model = models.get('yolo_nas_s',
                        num_classes=len(dataset_params['classes']),
                        checkpoint_path="train/ckpt_best.pth")

test_image = 'fire_smoke/train/images/large_(10).jpg'
best_model.predict(test_image, conf=0.35).show()

the output show the image with yolonas prediction (they have a bounding box), but if i try use the model to detect a video with the same code to load a model and add the code like this :

input_video_path = "testing.mp4"
output_video_path = "result_1.mp4"

best_model.to("cuda").predict(input_video_path, conf=0.3).save(output_video_path)

The algorithm don't do the prediction, the output is same like the input video (It's not contain any bounding box), I already read the docs but it's not help.

The process when i run the code to detect a video will be like this : Process when run the code for video detection

I use python 3.8.17, Nvidia GTX 1650 with CUDA 11.7 and cuDNN 8.9.3, super-gradients 3.1.3 and pytorch 1.13.1 (use this syntax for pytorch installation : conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia)

0

There are 0 answers