Spaces:
Runtime error
Runtime error
Code refactoring
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from deepface import DeepFace
|
|
8 |
from ultralytics import YOLO
|
9 |
import urllib.request
|
10 |
|
11 |
-
with open(
|
12 |
config = json.load(f)
|
13 |
|
14 |
FACE_DIST_TRESH = config['FACE_DIST_TRESH']
|
@@ -70,8 +70,8 @@ def create_image(images):
|
|
70 |
img_x = id_col_width + 10
|
71 |
y = text_margin
|
72 |
|
73 |
-
cv2.putText(table,
|
74 |
-
cv2.putText(table,
|
75 |
|
76 |
y += margin
|
77 |
|
@@ -125,11 +125,11 @@ with gr.Blocks(theme='soft', title='SquadDetective') as blocks:
|
|
125 |
gr.HTML(title)
|
126 |
gr.Markdown('SquadDetective is a service that helps sports teams to identify unclaimed players by comparing their faces to photos taken during matches. By using state-of-the-art facial recognition technology, SquadDetective can quickly and accurately match the faces of players in photos to a database of registered players, allowing teams to quickly identify any unclaimed players and take appropriate action. With SquadDetective, sports teams can ensure that all players are properly registered and eligible to play, helping to avoid potential penalties and other issues')
|
127 |
with gr.Row():
|
128 |
-
avatars = gr.inputs.File(label=
|
129 |
-
photos = gr.inputs.File(label=
|
130 |
inputs = [avatars, photos]
|
131 |
process_button = gr.Button('Process')
|
132 |
-
outputs=gr.outputs.Image(type=
|
133 |
process_button.click(fn=check, inputs=inputs, outputs=outputs)
|
134 |
|
135 |
blocks.launch()
|
|
|
8 |
from ultralytics import YOLO
|
9 |
import urllib.request
|
10 |
|
11 |
+
with open('config.json', 'r') as f:
|
12 |
config = json.load(f)
|
13 |
|
14 |
FACE_DIST_TRESH = config['FACE_DIST_TRESH']
|
|
|
70 |
img_x = id_col_width + 10
|
71 |
y = text_margin
|
72 |
|
73 |
+
cv2.putText(table, 'Image ID', (id_x, y), font, font_scale, color, thickness)
|
74 |
+
cv2.putText(table, 'Face', (img_x, y), font, font_scale, color, thickness)
|
75 |
|
76 |
y += margin
|
77 |
|
|
|
125 |
gr.HTML(title)
|
126 |
gr.Markdown('SquadDetective is a service that helps sports teams to identify unclaimed players by comparing their faces to photos taken during matches. By using state-of-the-art facial recognition technology, SquadDetective can quickly and accurately match the faces of players in photos to a database of registered players, allowing teams to quickly identify any unclaimed players and take appropriate action. With SquadDetective, sports teams can ensure that all players are properly registered and eligible to play, helping to avoid potential penalties and other issues')
|
127 |
with gr.Row():
|
128 |
+
avatars = gr.inputs.File(label='Avatar images (zip)')
|
129 |
+
photos = gr.inputs.File(label='Photos to be processed (zip)')
|
130 |
inputs = [avatars, photos]
|
131 |
process_button = gr.Button('Process')
|
132 |
+
outputs=gr.outputs.Image(type='numpy', label='Results')
|
133 |
process_button.click(fn=check, inputs=inputs, outputs=outputs)
|
134 |
|
135 |
blocks.launch()
|