Commit
•
9ee4f59
1
Parent(s):
545f292
mutimodel5
Browse files
app.py
CHANGED
@@ -11,12 +11,12 @@ def run_inference(input_image):
|
|
11 |
|
12 |
input_image.save(input_image_path) # Save the input image to disk
|
13 |
|
14 |
-
cmd = ['python', '
|
15 |
-
'--source', input_image_path, '--weights', '
|
16 |
|
17 |
subprocess.run(cmd)
|
18 |
|
19 |
-
folders = glob.glob('
|
20 |
folders = max(folders, key=os.path.getctime)
|
21 |
output_image_path = glob.glob('{}/*'.format(folders))[0]
|
22 |
output_image = Image.open(output_image_path)
|
|
|
11 |
|
12 |
input_image.save(input_image_path) # Save the input image to disk
|
13 |
|
14 |
+
cmd = ['python', 'yolov5-master/detect.py',
|
15 |
+
'--source', input_image_path, '--weights', 'yolov5m-multi-model.pt', '--name', 'detection']
|
16 |
|
17 |
subprocess.run(cmd)
|
18 |
|
19 |
+
folders = glob.glob('yolov5-master/runs/detect/*')
|
20 |
folders = max(folders, key=os.path.getctime)
|
21 |
output_image_path = glob.glob('{}/*'.format(folders))[0]
|
22 |
output_image = Image.open(output_image_path)
|