Spaces:
Sleeping
Sleeping
Commit
·
c75497e
1
Parent(s):
3fe713d
Update app.py
Browse files
app.py
CHANGED
@@ -412,10 +412,11 @@ def segment(image):
|
|
412 |
plt.subplot(1,2,2)
|
413 |
plt.imshow(context_rcnn_image)
|
414 |
plt.title('Context R-CNN')
|
415 |
-
|
416 |
-
plt.savefig('
|
417 |
-
im = Image.open(
|
|
|
418 |
return im
|
419 |
examples = os.listdir('../../Examples')
|
420 |
examples = ['../../Examples/' + item for item in examples]
|
421 |
-
gr.Interface(fn=segment, inputs = "file",outputs = "image", examples=examples,
|
|
|
412 |
plt.subplot(1,2,2)
|
413 |
plt.imshow(context_rcnn_image)
|
414 |
plt.title('Context R-CNN')
|
415 |
+
img_buf = io.BytesIO()
|
416 |
+
plt.savefig(img_buf, format='png')
|
417 |
+
im = Image.open(img_buf)
|
418 |
+
img_buf.close()
|
419 |
return im
|
420 |
examples = os.listdir('../../Examples')
|
421 |
examples = ['../../Examples/' + item for item in examples]
|
422 |
+
gr.Interface(fn=segment, inputs = "file",outputs = "image", examples=examples,enable_queue=True).launch()
|