Spaces:
Sleeping
Sleeping
Update utils/basic_functions.py
Browse files- utils/basic_functions.py +5 -1
utils/basic_functions.py
CHANGED
|
@@ -127,7 +127,11 @@ def huggingface_detect_id_box(model_name,url):
|
|
| 127 |
output = model.generate(**inputs,max_new_tokens=200,do_sample=False)
|
| 128 |
print(f"output: {output}")
|
| 129 |
|
| 130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
print(f"bbox: {bbox}")
|
| 132 |
|
| 133 |
|
|
|
|
| 127 |
output = model.generate(**inputs,max_new_tokens=200,do_sample=False)
|
| 128 |
print(f"output: {output}")
|
| 129 |
|
| 130 |
+
response_string = processor.decode(output[0][2:],skip_special_tokens=True)
|
| 131 |
+
print(f"response_string: {response_string}")
|
| 132 |
+
|
| 133 |
+
bbox = re.search(r"ASSISTANT: \[(.*?)\]",text)
|
| 134 |
+
bbox = [image.size[0],image.size[1],image.size[0],image.size[1]]*ast.literal_eval([bbox])
|
| 135 |
print(f"bbox: {bbox}")
|
| 136 |
|
| 137 |
|