Spaces:
Running
on
Zero
Running
on
Zero
update stuff 12
Browse files
__pycache__/utils.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/utils.cpython-310.pyc and b/__pycache__/utils.cpython-310.pyc differ
|
|
|
app.py
CHANGED
|
@@ -92,9 +92,24 @@ def process(
|
|
| 92 |
# coords_list = coords.tolist()
|
| 93 |
# coords_formatted = [f"{coord:.1f}" for coord in coords_list]
|
| 94 |
# coordinates_text += f"Box {box_id}: [{coords_formatted[0]}, {coords_formatted[1]}, {coords_formatted[2]}, {coords_formatted[3]}]\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
-
return image, str(parsed_content_list), str(
|
| 98 |
|
| 99 |
|
| 100 |
with gr.Blocks() as demo:
|
|
|
|
| 92 |
# coords_list = coords.tolist()
|
| 93 |
# coords_formatted = [f"{coord:.1f}" for coord in coords_list]
|
| 94 |
# coordinates_text += f"Box {box_id}: [{coords_formatted[0]}, {coords_formatted[1]}, {coords_formatted[2]}, {coords_formatted[3]}]\n"
|
| 95 |
+
|
| 96 |
+
combined_content = []
|
| 97 |
+
for i, content in enumerate(parsed_content_list):
|
| 98 |
+
if content.startswith('Text Box ID'):
|
| 99 |
+
box_id = str(i)
|
| 100 |
+
else:
|
| 101 |
+
# Extract the ID number from Icon Box ID format
|
| 102 |
+
box_id = content.split('Icon Box ID ')[1].split(':')[0]
|
| 103 |
|
| 104 |
+
coords = label_coordinates.get(box_id)
|
| 105 |
+
if coords is not None: # Changed from 'if coords:' to handle numpy arrays
|
| 106 |
+
coords_str = [round(x) for x in coords] # Convert numpy values to rounded integers
|
| 107 |
+
combined_content.append(f"{content} | Coordinates: {coords_str}")
|
| 108 |
+
else:
|
| 109 |
+
combined_content.append(content)
|
| 110 |
+
|
| 111 |
|
| 112 |
+
return image, str(parsed_content_list), str(combined_content)
|
| 113 |
|
| 114 |
|
| 115 |
with gr.Blocks() as demo:
|
imgs/saved_image_demo.png
CHANGED
|
|
util/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/util/__pycache__/__init__.cpython-310.pyc and b/util/__pycache__/__init__.cpython-310.pyc differ
|
|
|
util/__pycache__/box_annotator.cpython-310.pyc
CHANGED
|
Binary files a/util/__pycache__/box_annotator.cpython-310.pyc and b/util/__pycache__/box_annotator.cpython-310.pyc differ
|
|
|