Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
we0091234 committed Feb 20, 2023
1 parent 814259c commit 8886a92
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mytest_double/
pretrained_model/
gangao/
extra/
ccpd/
*.pyc
# 不忽略下面指定的文件类型
!*.cpp
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[yolov7 车牌检测+识别](https://github.com/we0091234/yolov7_plate)

## **最全车牌识别算法,支持14种中文车牌类型**
## **最全车牌识别算法,支持12种中文车牌类型**

**环境要求: python >=3.6 pytorch >=1.7**

Expand Down Expand Up @@ -85,11 +85,11 @@ python detect_plate.py --detect_model weights/plate_detect.pt --rec_model weigh
- [X] 7.双层黄牌
- [X] 8.双层武警
- [X] 9.使馆车牌
- [X] 10.港澳牌车
- [X] 10.港澳粤Z牌
- [X] 11.双层农用车牌
- [X] 12.民航车牌
- [X] 13.摩托车牌
- [X] 14.危险品车牌



![Image ](image/README/test_1.jpg)

Expand Down
22 changes: 11 additions & 11 deletions ccpd_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ def get_rect_and_landmarks(img_path):
for i in range(4):
landmarks_np[i][0]=landmarks[2*i]
landmarks_np[i][1]=landmarks[2*i+1]
middle_landmark_w =int((landmarks[4]+landmarks[6])/2)
middle_landmark_h =int((landmarks[5]+landmarks[7])/2)
landmarks.append(middle_landmark_w)
landmarks.append(middle_landmark_h)
# middle_landmark_w =int((landmarks[4]+landmarks[6])/2)
# middle_landmark_h =int((landmarks[5]+landmarks[7])/2)
# landmarks.append(middle_landmark_w)
# landmarks.append(middle_landmark_h)
landmarks_np_new=order_points(landmarks_np)
landmarks_np_new[4]=np.array([middle_landmark_w,middle_landmark_h])
# landmarks_np_new[4]=np.array([middle_landmark_w,middle_landmark_h])
return rect,landmarks,landmarks_np_new

def x1x2y1y2_yolo(rect,landmarks,img):
Expand All @@ -103,8 +103,8 @@ def x1x2y1y2_yolo(rect,landmarks,img):
annotation[0, 9] = landmarks[5] / h # l2_y
annotation[0, 10] = landmarks[6] / w # l3_x
annotation[0, 11] = landmarks[7] / h # l3_y
annotation[0, 12] = landmarks[8] / w # l4_x
annotation[0, 13] = landmarks[9] / h # l4_y
# annotation[0, 12] = landmarks[8] / w # l4_x
# annotation[0, 13] = landmarks[9] / h # l4_y
return annotation

def xywh2yolo(rect,landmarks_sort,img):
Expand All @@ -113,7 +113,7 @@ def xywh2yolo(rect,landmarks_sort,img):
rect[1] = max(0, rect[1])
rect[2] = min(w - 1, rect[2]-rect[0])
rect[3] = min(h - 1, rect[3]-rect[1])
annotation = np.zeros((1, 14))
annotation = np.zeros((1, 12))
annotation[0, 0] = (rect[0] + rect[2] / 2) / w # cx
annotation[0, 1] = (rect[1] + rect[3] / 2) / h # cy
annotation[0, 2] = rect[2] / w # w
Expand All @@ -127,8 +127,8 @@ def xywh2yolo(rect,landmarks_sort,img):
annotation[0, 9] = landmarks_sort[2][1] / h # l2_y
annotation[0, 10] = landmarks_sort[3][0] / w # l3_x
annotation[0, 11] = landmarks_sort[3][1] / h # l3_y
annotation[0, 12] = landmarks_sort[4][0] / w # l4_x
annotation[0, 13] = landmarks_sort[4][1] / h # l4_y
# annotation[0, 12] = landmarks_sort[4][0] / w # l4_x
# annotation[0, 13] = landmarks_sort[4][1] / h # l4_y
return annotation

def yolo2x1y1x2y2(annotation,img):
Expand All @@ -150,7 +150,7 @@ def write_lable(file_path):


if __name__ == '__main__':
file_root = r"ccpd/val"
file_root = r"ccpd"
file_list=[]
count=0
allFilePath(file_root,file_list)
Expand Down

0 comments on commit 8886a92

Please sign in to comment.