An open API service indexing awesome lists of open source software.

https://github.com/akashad98/yolov7_custom_data_trainig

yolov7 train on custom data
https://github.com/akashad98/yolov7_custom_data_trainig

deep-learning object-detection yolov7

Last synced: 5 months ago
JSON representation

yolov7 train on custom data

Awesome Lists containing this project

README

          

## yolov7 architecture

image

#### clone repo
1.``` git clone https://github.com/WongKinYiu/yolov7.git```

2. ```cd yolov7/```
3. ```!pip install requirements.txt```

4. script for dividing data into train,test & validation
```python yolov_train_test_split.py```

create customdata folder inside yolov7
data set download link :[customdata](https://drive.google.com/drive/folders/1u4IL2sGy2Hh84Xp3YyLENsd1SH437lea?usp=sharing)

image

-inside images paste all train & valid images

-inside labels all labels of train & valid image

. go insiode data folder & create custom_data.yaml
& add path of image & labels (i.e .txt)

```
# train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/]
train: ./customdata/train.txt
val: ./customdata/valid.txt

# number of classes
nc: 3

# class names
names: ['pistol','rifle','revolver']
```

for creating train.txt & val.txt use
(it contains the path of images )

!python [genrate_test.py]()

image

5. go inside cfg/training & select any .yaml file
do changes such as no classes
image

6. start training using

```!python train.py --workers 8 --device 0 --batch-size 16 --data data/custom_data.yaml --img 640 640 --cfg cfg/training/yolov7_custom_3.yaml --weights '' --name yolov7xcustom3 --hyp data/hyp.scratch.p5.yaml --epochs 200```

7. inference on video/image
```python yolov7_inference.py ``` # add alll file path inside this file

```python detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source inference/images/horses.jpg```