Spaces:
Runtime error
Runtime error
michaelwja
commited on
Commit
•
2f92a4a
1
Parent(s):
a81336d
Update app.py
Browse files
app.py
CHANGED
@@ -78,6 +78,12 @@ def query_image(image_path):
|
|
78 |
mask_img, dataframe = visualize_instance_seg_mask(img, results.numpy(), model.config.id2label, vegetation_labels)
|
79 |
return mask_img, dataframe
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
demo = gr.Interface(
|
83 |
title="Maskformer Satellite+Trees",
|
@@ -93,4 +99,4 @@ demo = gr.Interface(
|
|
93 |
analytics_enabled=None
|
94 |
)
|
95 |
|
96 |
-
demo.launch(show_api=True
|
|
|
78 |
mask_img, dataframe = visualize_instance_seg_mask(img, results.numpy(), model.config.id2label, vegetation_labels)
|
79 |
return mask_img, dataframe
|
80 |
|
81 |
+
def get_system_memory():
|
82 |
+
memory = psutil.virtual_memory()
|
83 |
+
memory_percent = memory.percent
|
84 |
+
memory_used = memory.used / (1024.0 ** 3)
|
85 |
+
memory_total = memory.total / (1024.0 ** 3)
|
86 |
+
return {"percent": f"{memory_percent}%", "used": f"{memory_used:.3f}GB", "total": f"{memory_total:.3f}GB"}
|
87 |
|
88 |
demo = gr.Interface(
|
89 |
title="Maskformer Satellite+Trees",
|
|
|
99 |
analytics_enabled=None
|
100 |
)
|
101 |
|
102 |
+
demo.launch(show_api=True)
|