Spaces:
Runtime error
Runtime error
fast process
Browse files- app.py +3 -1
- utils/__pycache__/util.cpython-38.pyc +0 -0
- utils/util.py +1 -1
app.py
CHANGED
|
@@ -72,6 +72,8 @@ def process_image(image_src, options=None, processor=None):
|
|
| 72 |
<h3>Region Semantic</h3>
|
| 73 |
<p>{region_semantic}</p>
|
| 74 |
</div>
|
|
|
|
|
|
|
| 75 |
<div style="flex: 1;">
|
| 76 |
<h3>GPT4 Reasoning:</h3>
|
| 77 |
<p>{gen_text}</p>
|
|
@@ -123,7 +125,7 @@ interface = gr.Interface(
|
|
| 123 |
\n Twitter: https://twitter.com/awinyimgprocess/status/1646225454599372800?s=46&t=HvOe9T2n35iFuCHP5aIHpQ
|
| 124 |
\n Since GPU is expensive, we use CPU for demo and not include semantic segment anything. Run code local with gpu or google colab we provided for fast speed.
|
| 125 |
\n Ttext2image model is controlnet ( very slow in cpu(~2m)), which used canny edge as reference.
|
| 126 |
-
\n To speed up, we generate image with small size
|
| 127 |
"""
|
| 128 |
)
|
| 129 |
|
|
|
|
| 72 |
<h3>Region Semantic</h3>
|
| 73 |
<p>{region_semantic}</p>
|
| 74 |
</div>
|
| 75 |
+
</div>
|
| 76 |
+
<div style="display: flex; flex-wrap: wrap;">
|
| 77 |
<div style="flex: 1;">
|
| 78 |
<h3>GPT4 Reasoning:</h3>
|
| 79 |
<p>{gen_text}</p>
|
|
|
|
| 125 |
\n Twitter: https://twitter.com/awinyimgprocess/status/1646225454599372800?s=46&t=HvOe9T2n35iFuCHP5aIHpQ
|
| 126 |
\n Since GPU is expensive, we use CPU for demo and not include semantic segment anything. Run code local with gpu or google colab we provided for fast speed.
|
| 127 |
\n Ttext2image model is controlnet ( very slow in cpu(~2m)), which used canny edge as reference.
|
| 128 |
+
\n To speed up, we generate image with small size 384, run the code local for high-quality sample.
|
| 129 |
"""
|
| 130 |
)
|
| 131 |
|
utils/__pycache__/util.cpython-38.pyc
CHANGED
|
Binary files a/utils/__pycache__/util.cpython-38.pyc and b/utils/__pycache__/util.cpython-38.pyc differ
|
|
|
utils/util.py
CHANGED
|
@@ -15,7 +15,7 @@ def read_image_width_height(image_path):
|
|
| 15 |
return width, height
|
| 16 |
|
| 17 |
|
| 18 |
-
def resize_long_edge(image, target_size=
|
| 19 |
# Calculate the aspect ratio
|
| 20 |
width, height = image.size
|
| 21 |
aspect_ratio = float(width) / float(height)
|
|
|
|
| 15 |
return width, height
|
| 16 |
|
| 17 |
|
| 18 |
+
def resize_long_edge(image, target_size=384):
|
| 19 |
# Calculate the aspect ratio
|
| 20 |
width, height = image.size
|
| 21 |
aspect_ratio = float(width) / float(height)
|