https://github.com/ajithvcoder/Custom_Objectdetection_Yolov5
Contains code to train custom images on Yolov5
https://github.com/ajithvcoder/Custom_Objectdetection_Yolov5
Last synced: about 1 month ago
JSON representation
Contains code to train custom images on Yolov5
- Host: GitHub
- URL: https://github.com/ajithvcoder/Custom_Objectdetection_Yolov5
- Owner: ajithvcoder
- Created: 2021-07-24T13:10:40.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-24T13:15:27.000Z (almost 4 years ago)
- Last Synced: 2024-05-22T03:08:01.014Z (about 1 year ago)
- Language: Jupyter Notebook
- Size: 4.8 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### YoloV5 Custom Object training
Colab notebook - [here](https://colab.research.google.com/drive/1CGXHcgIS9Gv7QXtFdgdHL13Wy3k4Vdg3?usp=sharing)
it is also available [here](./Custom_YOLOv5_Training_Tutorial.ipynb)
**Steps for training**
**Data preparation**
- You can refer customim.zip file for data preparation
- Download 30 images of two classes - 15 images for car and 15 images for flight
- You can go to this site https://www.makesense.ai/ and upload all images
- Now you can give the label names and then start annotation
- click Actions-->Export annotations1) In colab notbook do the setup
2) Upload data(customim.zip)(avaliable in this repo)/ custom data to colab and place it in "datasets" folder. Make like below tree structure```
# Tree structure
datasets
---->customim
--->images
-->train
-->001.jpg
-->002.jpg
...
--->labels
-->train
-->001.txt
-->002.txt
...
```3) Modify coco128.yaml file like below with path of custom dataset , number of classes and class names
**coco128.yaml**
```# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: ../datasets/customim # dataset root dir
train: images/train # train images (relative to 'path') 128 images
val: images/train # val images (relative to 'path') 128 images
test: # test images (optional)# Classes
nc: 2 # number of classes
names: [ 'car','flight' ] # class names```
4) you can run the cell to train for 200 epochs
5) Upload the [test images](./test.zip) or your own test images to colab
5) Now you can provide the path of weights and test images to detect.py```
!python detect.py --weights runs/train/exp5/weights/last.pt --img 640 --conf 0.25 --source test/
```#### Results



