my
Browse files
app.py
CHANGED
@@ -89,15 +89,15 @@ def process_image():
|
|
89 |
bounding_box_annotator = sv.BoundingBoxAnnotator()
|
90 |
label_annotator = sv.LabelAnnotator()
|
91 |
image_dir = "./data1"
|
92 |
-
files = os.listdir('./
|
93 |
files.sort()
|
94 |
files = files[0:100]
|
95 |
print(files)
|
96 |
counter = 0
|
97 |
for ii in files:
|
98 |
-
random_image_data = cv2.imread('./
|
99 |
-
random_image_data1 = cv2.imread('./
|
100 |
-
results = model(source='./
|
101 |
detections = sv.Detections.from_ultralytics(results)
|
102 |
annotated_image = bounding_box_annotator.annotate(scene=random_image_data, detections=detections)
|
103 |
annotated_image = label_annotator.annotate(scene=annotated_image, detections=detections)
|
@@ -124,9 +124,12 @@ def process_image():
|
|
124 |
model_storage_directory='./EasyOCR-Trainer/EasyOCR/easyocr/model',
|
125 |
user_network_directory='./EasyOCR-Trainer/EasyOCR/user_network')
|
126 |
import re
|
127 |
-
input_file_path = '
|
128 |
-
cropped_images_folder = '
|
129 |
-
output_csv_path = '
|
|
|
|
|
|
|
130 |
with open(input_file_path, 'r') as infile:
|
131 |
lines = infile.readlines()
|
132 |
with open(output_csv_path, 'w', newline='', encoding='utf-8') as csvfile:
|
|
|
89 |
bounding_box_annotator = sv.BoundingBoxAnnotator()
|
90 |
label_annotator = sv.LabelAnnotator()
|
91 |
image_dir = "./data1"
|
92 |
+
files = os.listdir('./data1')
|
93 |
files.sort()
|
94 |
files = files[0:100]
|
95 |
print(files)
|
96 |
counter = 0
|
97 |
for ii in files:
|
98 |
+
random_image_data = cv2.imread('./data1/' + ii)
|
99 |
+
random_image_data1 = cv2.imread('./data1/' + ii)
|
100 |
+
results = model(source='./data1/' + ii, conf=0.07)[0]
|
101 |
detections = sv.Detections.from_ultralytics(results)
|
102 |
annotated_image = bounding_box_annotator.annotate(scene=random_image_data, detections=detections)
|
103 |
annotated_image = label_annotator.annotate(scene=annotated_image, detections=detections)
|
|
|
124 |
model_storage_directory='./EasyOCR-Trainer/EasyOCR/easyocr/model',
|
125 |
user_network_directory='./EasyOCR-Trainer/EasyOCR/user_network')
|
126 |
import re
|
127 |
+
input_file_path = './bounding_boxes.txt'
|
128 |
+
cropped_images_folder = './cropped_images/'
|
129 |
+
output_csv_path = './Folder2/' + ii + 'bounding_boxes_with_recognition.csv'
|
130 |
+
print(f"Checking contents of /mnt/data: {bounding_box_save_path}")
|
131 |
+
print(f"Directory listing: {os.listdir('/mnt/data')}")
|
132 |
+
|
133 |
with open(input_file_path, 'r') as infile:
|
134 |
lines = infile.readlines()
|
135 |
with open(output_csv_path, 'w', newline='', encoding='utf-8') as csvfile:
|