DETECTRON2 - Training on Custom Dataset 🔥🔥
HTML-код
- Опубликовано: 29 сен 2024
- #detectron2 #theartificialguy #deeplearning
Hello all, so it took me a while creating this video and finally I came up with it. So, in this video, we will be training DETECTRON2 on a CUSTOM dataset. I used Skin Disease dataset for this tutorial. The same procedure can be applied on any other kind of dataset.
Do check out my previous video in which I have implemented 4 Advanced Computer Vision tasks like Object detection, Keypoints detection, Instance segmentation and Panoptic segmentation.
Link: • DETECTRON2 - 4 Advance...
Click for surprise or subscribe? : bit.ly/377M8Nb
My website where I have written many blogs similar to this video.
Link: bugspeed.xyz
Code: github.com/yas...
Dataset: drive.google.c...
Support and show your love: bit.ly/377M8Nb
Please do hit LIKE, SHARE the video and SUBSCRIBE to the channel because that's what keep me motivated to create such videos.
This is such a great tutorial.
Can you please make a tutorial using Vision Transformer for training on custom dataset for instance segmentation task?
Great Video. Can you explain the part of labelling for panoptic segmentation as well? How should we add instance ids to the json file?
Great effort. I suppose you make modification ti available tutorial of detectron2 on collab notebook
amazing god job
Hi bro can you do a video for panoptic segmentation with custom data training please
Thank you very much for this tutorial. unfortunately i have a error KeyError: 'imagePath' on my trainer. I checked every single code for that but i found anything incorrect. please help meeeee !!!!
did you solve this error bcd i also got the same key error ?
Dataset link not working
the code is showing "No CUDA GPUs are available" error, please help!
Did you get the answer
hi , i have trained the model on custom dataset, and the total loss is decreasing also, but while prediction its not predicting anything, just printing grayscale images. please help
@@shradhasharma4260 lower the confidence score
Great video!!! You might've saved me from an entire day of head scratching. Thanks!!! 🤟
Can you please let me know how can I input the video in this and get the video with bounding boxes and mask
Thanks for the video. FileNotFoundError: [Errno 2] No such file or directory: '/content/drive/MyDrive/datasets/train/..\\images\\potholedataset_(1).jpg' Why cannot it find the image file? It shows up in the trainer.train() step.
Please double check your path, or you can just try to read an image from your directory to make sure you've set the correct path, something like : img = cv2.imread("your_path_here")
Or if you're using colab you can open file navigation from left panel and right click on any image then select "copy path" and double check it.
Or you can type "pwd" in a cell to get the current working directory full path and use that instead...
Hope it works!
Thank you for the video. Could you help me with how to use a different backbone? like googlenet instead of resnet. Thanks in advance
how to predict a new images without labeling? :(((
i mean how to use a model with a new image? :D i need your help
@@syalwadea Hi, you could do something like this:
```
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
cfg = get_cfg()
cfg.MODEL.WEIGHTS = os.path.join("path_to_your_model_file.pth")
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 2 // your task num classes
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5
predictor = DefaultPredictor(cfg)
img = cv2.imread("path _to_img")
outputs = predictor (img)
And then the same code for visualization, i hope it helped!
```
pytorch 1.9 is indeed compatible.
while running "trainer = DefaultTrainer(cfg)" i am getting the error that Cuda is not available. How to fix that problem
in colab first set the path runtime as GPU
Why it's showing as segmentation when we're need detection
Cool
i get eror said
OSError: [Errno 107] Transport endpoint is not connected: './output' how can i solve it ?
how can we get approx size of the object cm from mask? or is there any way to do it? can it be done while labelling the images if yes then how?
hi!
Great tutorial! Help me please, how i can convert "pth" format to "onnx"? I want to use this in opencv. Help me please!!!!!!!
i have a validation data set as well. how can I use them or how can I edit the code in order to use the validation data,so that I can see the validation loss and training loss curve,to comment on if its underfitting or overfitting. Please response
Very helpful video...
How can we perform evaluatio of the trained model ?
Plz help
I get the error as: AttributeError: _func in detectron2/engine/hooks.py
how can i solve it?
thanks for the video! But also, your microphone is not in a good situation, I think.
This code is not going to work when we send a fresh image for prediction with annotations
can you help me to add a line of code to calculate the evaluation of the mAP training model?
Instead of showing the predictions in an image how can i get names of predictions?
thanks for the tutorial! can you also please create a video on how to load trained models?
So why do the test data also have to have the JSON-file? I thought that I could just upload pictures without any labeling to a trained model and only the training data would require the labeling?
My exact question!
bro i need a file to run this model directily on single image can you help me
Can these steps be used for detecting key point of animals like dogs? If yes how can i do so can u please give a little bit of advice or Not is there any way to acheive this without using any state-of-art libraries like mmpose and deeplabcut?
why not? But first of all, you should create the coordinates...
Thank you for the video. Where is the colab link?
hi,
i want to use Faster R-CNN for detection plants diseases in this code.
how to use Faster R-CNN model in this code please help me.
hey if you done the above code then will you plz help me?
Amazing tutorial. How do I test it on data that does not have json files? just a 100% new image.
are you find the answer? :(
Can anyone tell how to change the size of images
where can i get the same code shown in colab
Well the tutorial worked and i used it to classifie street signs but in testing it didn´t recognise something in the picture could someone help me with that?
how you tackle this issue? bec i am also facing the same problem :/
thank you for uploading this video. it helped me a lot, i tried to implement this detectron2 in my project, and i completely seen my custum data work. thank you for sharing. thanks!
Glad it helped! Don't forget to leave a like and subscribe!
I keep getting an error message, No such file or directory: '/content/drive/MyDrive/datatrain', when I run the trainer. Any help would be appreciated!
Please check the path that you are using and make sure you have the file on that directory you mentioned!
put a / at the end of your path
@@mohammadrajabi3152 this works👍
can you also add a few lines of code to evaluate the model?
Great video! And your code worked well with no issues! Thank you! Question: Once I am done training the model, is there a way to download it (as a file) to use it by inference on a Python program running in my local laptop?
You can download the model directly from Colab and use it locally.
@@Imdeepmind Oh yes. Thank you. I have another question. How can I export an ONNX model out of this model? I have been breaking my head looking online and all I find are samples on existing models from model zoo but, nothing on a custom model. Any ideas? 😕
Nice One!
Cool
cool!
COOL
how to deploy it in mobile phone or coverting it to tensorflowlite
Will make a tutorial soon!
great tutorial.
thanks
Dose detectron2 runs on rtx3090 ?
Absolutely, make sure you have installed CUDA toolkit and Cudnn.
For more details you can visit nvidia site: www.nvidia.com/object/geforce_family.html
And if you liked the video, do not forget to subscribe to the channel :D
@@theartificialguy6898 thx bro, sure, im subscribed 👍
thanks sir, this video is amazing 🔥
Glad you found it helpful! Please do leave a like and subscribe to the channel :)
This is a really great tutorial. It's perfectly paced and explained everything without explaining too much that's not needed for the specific task of training a model using custom data. Great work.
Glad to hear! Thanks;
Please do consider linking the video and subscribing to the channel :D
@@theartificialguy6898 Hi thanks for this video. There are TONS of YT vids on Detectron2 for object detection and instance segmentation but NONE on semantic segmentation for custom datasets. Can you be the one that fill the gap?
Man, I created a customized model with 3 classes (A, B and C). And I would like to take especific masks for a especific object. And I use this code: mask_A = outputs['instances'].pred_masks.cpu().numpy()[0]