| |
| import os |
| def text_create(name): |
| Annotations_path = "/home/ricky/sh/phone_detect/data/phone/Annotations/" |
| yolo_path="/home/ricky/sh/phone_detect/data/phone/labels/" |
| full_Annotations_path =Annotations_path + name + '.xml' |
| full_yolo_path = yolo_path + name + '.txt' |
| file = open(full_yolo_path, 'w') |
| file.close() |
| file=open(full_Annotations_path, 'w') |
| file.close() |
| |
| |
| IamgesPath = '/home/ricky/sh/phone_detect/data/phone/1_no_phone' |
| for i,j,k in os.walk(IamgesPath): |
| for s in k: |
| s=s[:-4] |
| text_create(s) |
| print(s) |
|
|