Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
we0091234 committed Mar 27, 2023
1 parent 32c029a commit db66690
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#### **图片测试demo:**

直接运行detect_plate.py 或者运行如下命令行:

```
python detect_plate.py --detect_model weights/plate_detect.pt --rec_model weights/plate_rec_color.pth --image_path imgs --output result
```
Expand All @@ -37,11 +39,13 @@ python detect_plate.py --detect_model weights/plate_detect.pt --rec_model weigh

关键点依次是(左上,右上,右下,左下)
坐标都是经过归一化,x,y是中心点除以图片宽高,w,h是框的宽高除以图片宽高,ptx,pty是关键点坐标除以宽高

**自己的数据集**可以通过lablme 软件,create polygons标注车牌四个点即可,然后通过json2yolo.py 将数据集转为yolo格式,即可训练
2. **修改 data/widerface.yaml train和val路径,换成你的数据路径**

```
train: /your/train/path #修改成你的路径
val: /your/val/path #修改成你的路径
train: /your/train/path #修改成你的训练集路径
val: /your/val/path #修改成你的验证集路径
# number of classes
nc: 2 #这里用的是2分类,0 单层车牌 1 双层车牌
Expand All @@ -52,7 +56,7 @@ python detect_plate.py --detect_model weights/plate_detect.pt --rec_model weigh
3. **训练**

```
python3 train.py --data data/widerface.yaml --cfg models/yolov5n-0.5.yaml --weights weights/plate_detect.pt --epoch 250
python3 train.py --data data/widerface.yaml --cfg models/yolov5n-0.5.yaml --weights weights/plate_detect.pt --epoch 120
```

结果存在run文件夹中
Expand Down Expand Up @@ -95,7 +99,7 @@ python detect_plate.py --detect_model weights/plate_detect.pt --rec_model weigh

## 部署

1. [安卓NCNN](https://github.com/Ayers-github/Chinese-License-Plate-Recognition)
1.[安卓NCNN](https://github.com/Ayers-github/Chinese-License-Plate-Recognition)

2.**onnx demo** 百度网盘**[k874](https://pan.baidu.com/s/1K3L3xubd6pXIreAydvUm4g)**

Expand All @@ -114,7 +118,7 @@ python onnx_infer.py --detect_model weights/plate_detect.onnx --rec_model weigh
## References

* [https://github.com/deepcam-cn/yolov5-face](https://github.com/deepcam-cn/yolov5-face)
* [https://github.com/meijieru/crnn.pytorch](https://github.com/meijieru/crnn.pytorch)
* [https://github.com/Sierkinhane/CRNN_Chinese_Characters_Rec](https://github.com/Sierkinhane/CRNN_Chinese_Characters_Rec)

## 联系

Expand Down
2 changes: 1 addition & 1 deletion detect_plate.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def get_second(capture):
parser.add_argument('--is_color',type=bool,default=True,help='plate color') #是否识别颜色
parser.add_argument('--image_path', type=str, default='imgs', help='source') #图片路径
parser.add_argument('--img_size', type=int, default=640, help='inference size (pixels)') #网络输入图片大小
parser.add_argument('--output', type=str, default='result1', help='source') #图片结果保存的位置
parser.add_argument('--output', type=str, default='result', help='source') #图片结果保存的位置
parser.add_argument('--video', type=str, default='', help='source') #视频的路径
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") #使用gpu还是cpu进行识别
# device =torch.device("cpu")
Expand Down

0 comments on commit db66690

Please sign in to comment.