Spaces:
Runtime error
Runtime error
ivelin
commited on
Commit
·
4bfe622
1
Parent(s):
1b7baab
fix: cleanup
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 = math.floor(
|
64 |
-
ymin = math.floor(
|
65 |
-
xmax = math.floor(
|
66 |
-
ymax = math.floor(
|
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 = width*math.floor(bbox["xmin"]) if bbox.get("xmin") else 0
|
64 |
+
ymin = height*math.floor(bbox["ymin"]) if bbox.get("ymin") else 0
|
65 |
+
xmax = width*math.floor(bbox["xmax"]) if bbox.get("xmax") else 1
|
66 |
+
ymax = height*math.floor(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}")
|