T.Masuda commited on
Commit ·
4704d12
1
Parent(s): 08f3069
update app.py
Browse files
app.py
CHANGED
|
@@ -18,6 +18,7 @@ def process_image(image):
|
|
| 18 |
|
| 19 |
generator = SegmentAnything()
|
| 20 |
masks = generator.generate(image)
|
|
|
|
| 21 |
index = 0
|
| 22 |
for mask in masks:
|
| 23 |
if index >= len(colors):
|
|
@@ -37,5 +38,5 @@ app = gr.Interface(
|
|
| 37 |
examples=[['examples/example1.jpg'], ['examples/example2.jpg']],
|
| 38 |
#cache_examples=False
|
| 39 |
)
|
| 40 |
-
app.queue(concurrency_count=
|
| 41 |
app.launch()
|
|
|
|
| 18 |
|
| 19 |
generator = SegmentAnything()
|
| 20 |
masks = generator.generate(image)
|
| 21 |
+
masks = sorted(masks, key=lambda x: x['area'], reverse=True)
|
| 22 |
index = 0
|
| 23 |
for mask in masks:
|
| 24 |
if index >= len(colors):
|
|
|
|
| 38 |
examples=[['examples/example1.jpg'], ['examples/example2.jpg']],
|
| 39 |
#cache_examples=False
|
| 40 |
)
|
| 41 |
+
app.queue(concurrency_count=20)
|
| 42 |
app.launch()
|