Spaces:
Sleeping
Sleeping
Commit
·
acd80f7
1
Parent(s):
0e0b85a
Update app.py
Browse files
app.py
CHANGED
@@ -399,7 +399,19 @@ def segment(image):
|
|
399 |
plt.rcParams['ytick.left'] = False
|
400 |
plt.rcParams['ytick.right'] = False
|
401 |
plt.rcParams['figure.figsize'] = [15,10]
|
402 |
-
|
403 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
|
405 |
gr.Interface(fn=segment, inputs="image", outputs="image").launch()
|
|
|
399 |
plt.rcParams['ytick.left'] = False
|
400 |
plt.rcParams['ytick.right'] = False
|
401 |
plt.rcParams['figure.figsize'] = [15,10]
|
402 |
+
date_captured = Image.open(image)._getexif()[36867]
|
403 |
+
context_feature, score, results = run_inference(
|
404 |
+
faster_rcnn_model, image, date_captured)
|
405 |
+
faster_rcnn_output_dict = results
|
406 |
+
context_rcnn_image, faster_rcnn_image = show_context_rcnn_inference(
|
407 |
+
context_rcnn_model, image, context_features_matrix,
|
408 |
+
faster_rcnn_output_dict, context_padding_size)
|
409 |
+
plt.subplot(1,2,1)
|
410 |
+
plt.imshow(faster_rcnn_image)
|
411 |
+
plt.title('Faster R-CNN')
|
412 |
+
plt.subplot(1,2,2)
|
413 |
+
plt.imshow(context_rcnn_image)
|
414 |
+
plt.title('Context R-CNN')
|
415 |
+
return plt
|
416 |
|
417 |
gr.Interface(fn=segment, inputs="image", outputs="image").launch()
|