Spaces:
Runtime error
Runtime error
ivelin
commited on
Commit
·
2cb7e1c
1
Parent(s):
4bfe622
fix: cleanup bugs
Browse filesSigned-off-by: ivelin <ivelin.eth@gmail.com>
app.py
CHANGED
@@ -60,10 +60,10 @@ def process_refexp(image: Image, prompt: str):
|
|
60 |
print(f"image width, height: {width, height}")
|
61 |
print(f"processed prompt: {prompt}")
|
62 |
|
63 |
-
xmin =
|
64 |
-
ymin =
|
65 |
-
xmax =
|
66 |
-
ymax =
|
67 |
|
68 |
print(
|
69 |
f"to image pixel values: xmin, ymin, xmax, ymax: {xmin, ymin, xmax, ymax}")
|
|
|
60 |
print(f"image width, height: {width, height}")
|
61 |
print(f"processed prompt: {prompt}")
|
62 |
|
63 |
+
xmin = math.floor(width*float(bbox["xmin"])) if bbox.get("xmin") else 0
|
64 |
+
ymin = math.floor(height*float(bbox["ymin"])) if bbox.get("ymin") else 0
|
65 |
+
xmax = math.floor(width*float(bbox["xmax"])) if bbox.get("xmax") else 1
|
66 |
+
ymax = math.floor(height*float(bbox["ymax"])) if bbox.get("ymax") else 1
|
67 |
|
68 |
print(
|
69 |
f"to image pixel values: xmin, ymin, xmax, ymax: {xmin, ymin, xmax, ymax}")
|