PUTvision / qgis-plugin-deepness

Deepness is a remote sensing plugin that enables deep learning inference in QGIS
https://www.buymeacoffee.com/deepness
Apache License 2.0
90 stars 22 forks source link

Deepness Segmentor file roading error #170

Open JeongbaeJeon opened 3 months ago

JeongbaeJeon commented 3 months ago

hello.

First of all, thank you so much for creating the deepness plugin for qgis.

I am studying the field of detecting objects using drone images. We are using YOLOv5 and YOLOv8 for object detection. The .pt file learned in YOLO is converted to an onnx file, and Deepness's Detect model is performed perfectly without error. However, when converting a .pt file learned using the Segmentation model to an onnx file and using Deepness' Segmentor model, the following error occurs.

image

I don't understand what this error means, is there any solution?

bartoszptak commented 3 months ago

Could you share any information about your model, the repository you used to train, and the command you used to export? If it possible, you can share to me your onnx model as well, I'll check what is wrong.

GeoLuisAmarilla commented 3 months ago

Could you share any information about your model, the repository you used to train, and the command you used to export? If it possible, you can share to me your onnx model as well, I'll check what is wrong.

Hello, I have the same problem, I used Ultralytics to train and export the model with the YOLOv8l-SEG architecture link to model: https://hub.ultralytics.com/models/RKCFCsGnktxMMevHlTSi

JeongbaeJeon commented 3 months ago

I cloned ultralytics' code and studied it with Yolo8s-seg.pt.

python code: yolo segment train model=yolov8s-seg.pt data='./data.yaml' epochs=200 imgsz=1024

The best.pt file saved through this was converted to an onnx file using the code shown in the picture below.

image

I will provide you with a link to share the created file.

https://drive.google.com/drive/folders/1Bvbil8xRWTeE4HI7ZC3C7gYObcHSflr0?usp=drive_link

bartoszptak commented 3 months ago

@JeongbaeJeon

I will provide you with a link to share the created file.

https://drive.google.com/drive/folders/1Bvbil8xRWTeE4HI7ZC3C7gYObcHSflr0?usp=drive_link

I've loaded your model and inferred without any issues. Are you sure, that the correct model type and YOLO type were selected?

image

bartoszptak commented 3 months ago

@GeoLuisAmarilla

Hello, I have the same problem, I used Ultralytics to train and export the model with the YOLOv8l-SEG architecture link to model: https://hub.ultralytics.com/models/RKCFCsGnktxMMevHlTSi

It is highly unpleasant that you provide the link to a model that is behind a barrier and the Ultralytics account is required. We will not help you until you provide the model in onnx.

Martin-Dawson commented 3 months ago

I have the same issue with an ONNX export from Ultralytics. The model used was a Yolov8m segmentation and displays acceptable results in the Ultralytics preview. A link to the model file is here: https://1drv.ms/u/s!Aq_JPactK6wGjKVSwNr9JLkS8SsLPQ?e=ey9mdD

bartoszptak commented 3 months ago

@Martin-Dawson your model works totally fine for me. Do you use YOLO_ultralytics_segmentarion or Segmentowe model? There is huge difference between instance segmentation and semantic segmentation tasks.

Martin-Dawson commented 3 months ago

Bartosz, I believe I used YOLO_ultralytics_segmentation. The problem I have is on trying to load the model: [cid:3452b34b-e333-4c15-a2a5-2e2e736ca812]

https://1drv.ms/i/s!Aq_JPactK6wGjKVTuO8LvdOjBQZIcA?e=5BzKeG

Best regards,

Martin Dawson

07572 345 486


From: Bartosz Ptak @.> Sent: 01 May 2024 20:46 To: PUTvision/qgis-plugin-deepness @.> Cc: Martin-Dawson @.>; Mention @.> Subject: Re: [PUTvision/qgis-plugin-deepness] Deepness Segmentor file roading error (Issue #170)

@Martin-Dawsonhttps://github.com/Martin-Dawson your model works totally fine for me. Do you use YOLO_ultralytics_segmentarion or Segmentowe model? There is huge difference between instance segmentation and semantic segmentation tasks.

— Reply to this email directly, view it on GitHubhttps://github.com/PUTvision/qgis-plugin-deepness/issues/170#issuecomment-2089002283, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BC3PZPFRETSE7CWVXKDF7BLZAFA7ZAVCNFSM6AAAAABG7LQGJGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBZGAYDEMRYGM. You are receiving this because you were mentioned.

JeongbaeJeon commented 3 months ago

The onnx file I built loads without error in Deepness's Detector model. However, when I load the file in Segmentor model, I get an error. You can run it by selecting YOLO_Ultralytics_segmentation as the type of detection parameters in the detector model. However, I would like to try the Segmentor model. I wonder why this happens.

image

GeoLuisAmarilla commented 3 months ago

@GeoLuisAmarilla

Hello, I have the same problem, I used Ultralytics to train and export the model with the YOLOv8l-SEG architecture link to model: https://hub.ultralytics.com/models/RKCFCsGnktxMMevHlTSi

It is highly unpleasant that you provide the link to a model that is behind a barrier and the Ultralytics account is required. We will not help you until you provide the model in onnx.

I'm so sorry!!!. I thought it would be open to download without login. I put it on a drive: https://drive.google.com/file/d/1O6VE06OwszRJunljo6tOab8D1raqynov/view?usp=sharing

przemyslaw-aszkowski commented 3 months ago

@JeongbaeJeon The YOLO_Ultralytics_segmentation model needs to be used as Detector. The Segmentor models are only for models with the following output: [BATCH_SIZE, 1, SIZE_PX, SIZE_PX].

@GeoLuisAmarilla Thanks for the file, your model works! You just need to select the proper detector class, as there are many different YOLO models. See the configuration on my screenshot: image

@Martin-Dawson I believe it is the same case as above, see the configuration on my screenshot (especially the configuration in red boxes).

Let me know if there are any other issues, and please share the results of your models once you are happy with them!

Cheers Przemek

GeoLuisAmarilla commented 3 months ago

@JeongbaeJeon The YOLO_Ultralytics_segmentation model needs to be used as Detector. The Segmentor models are only for models with the following output: [BATCH_SIZE, 1, SIZE_PX, SIZE_PX].

@GeoLuisAmarilla Thanks for the file, your model works! You just need to select the proper detector class, as there are many different YOLO models. See the configuration on my screenshot: image

@Martin-Dawson I believe it is the same case as above, see the configuration on my screenshot (especially the configuration in red boxes).

Let me know if there are any other issues, and please share the results of your models once you are happy with them!

Cheers Przemek

Hello. Yes it works without any errors! but in the detection option it only draws the detected boundaries and does not perform the segmentation. It looks like this: Screenshot 2024-05-23 110525

bartoszptak commented 3 months ago

Hello. Yes it works without any errors! but in the detection option it only draws the detected boundaries and does not perform the segmentation. It looks like this: Screenshot 2024-05-23 110525

Could you share a screenshot of your Deepness config you set before inference? Could you share informations about operating system, qgis version, deepness version. Could you shortly describe how you prepare your model (I'm mostly asking about dataset labels etc).