Spaces:
Build error
Build error
remove try catch
Browse files
app.py
CHANGED
@@ -24,17 +24,14 @@ def add_text_to_image(
|
|
24 |
):
|
25 |
image = Image.fromarray(image)
|
26 |
draw = ImageDraw.Draw(image)
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
)
|
36 |
-
except:
|
37 |
-
image = draw.text(position, text, fill=color, font=ImageFont.load_default())
|
38 |
return np.array(image)
|
39 |
|
40 |
|
@@ -106,27 +103,27 @@ This relevancy extractor builds heavily on [Chefer et al.'s codebase](https://gi
|
|
106 |
"ours_fast",
|
107 |
True,
|
108 |
],
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
],
|
131 |
)
|
132 |
# iface.launch(share=True)
|
|
|
24 |
):
|
25 |
image = Image.fromarray(image)
|
26 |
draw = ImageDraw.Draw(image)
|
27 |
+
draw.text(
|
28 |
+
position,
|
29 |
+
text,
|
30 |
+
fill=color,
|
31 |
+
font=ImageFont.truetype(
|
32 |
+
"/usr/share/fonts/truetype/lato/Lato-Medium.ttf", fontsize
|
33 |
+
),
|
34 |
+
)
|
|
|
|
|
|
|
35 |
return np.array(image)
|
36 |
|
37 |
|
|
|
103 |
"ours_fast",
|
104 |
True,
|
105 |
],
|
106 |
+
[
|
107 |
+
"https://semantic-abstraction.cs.columbia.edu/downloads/livingroom.png",
|
108 |
+
"monopoly boardgame set,door knob,sofa,coffee table,plant,carpet,wall",
|
109 |
+
"a photograph of a {} in a home.",
|
110 |
+
"ours_fast",
|
111 |
+
True,
|
112 |
+
],
|
113 |
+
[
|
114 |
+
"https://semantic-abstraction.cs.columbia.edu/downloads/fireplace.png",
|
115 |
+
"fireplace,beige armchair,candle,large indoor plant in a pot,forest painting,cheetah-patterned pillow,floor,carpet,wall",
|
116 |
+
"a photograph of a {} in a home.",
|
117 |
+
"ours_fast",
|
118 |
+
True,
|
119 |
+
],
|
120 |
+
[
|
121 |
+
"https://semantic-abstraction.cs.columbia.edu/downloads/walle.png",
|
122 |
+
"WALL-E,a fire extinguisher",
|
123 |
+
"a 3D render of {}.",
|
124 |
+
"ours_fast",
|
125 |
+
True,
|
126 |
+
],
|
127 |
],
|
128 |
)
|
129 |
# iface.launch(share=True)
|