Spaces:
Runtime error
Runtime error
EduardoPach
commited on
Commit
·
de35370
1
Parent(s):
f892f53
Add some explanations
Browse files
app.py
CHANGED
|
@@ -78,9 +78,23 @@ def app_fn(
|
|
| 78 |
return fig_pca
|
| 79 |
|
| 80 |
if __name__=="__main__":
|
| 81 |
-
title = "DINOv2 Features Visualization"
|
| 82 |
with gr.Blocks(title=title) as demo:
|
| 83 |
gr.Markdown(f"# {title}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
with gr.Row():
|
| 85 |
threshold = gr.Slider(minimum=0, maximum=1, value=0.6, step=0.05, label="Threshold")
|
| 86 |
object_larger_than_bg = gr.Checkbox(label="Object Larger than Background", value=False)
|
|
|
|
| 78 |
return fig_pca
|
| 79 |
|
| 80 |
if __name__=="__main__":
|
| 81 |
+
title = "🦖 DINOv2 Features Visualization 🦖"
|
| 82 |
with gr.Blocks(title=title) as demo:
|
| 83 |
gr.Markdown(f"# {title}")
|
| 84 |
+
gr.Markdown(
|
| 85 |
+
"""
|
| 86 |
+
### This app visualizes the features extracted by [DINOv2](https://arxiv.org/pdf/2304.07193.pdf) model. \
|
| 87 |
+
To create the visualizations we use a 2-step PCA. \
|
| 88 |
+
The first step we reduce the features to 3 dimensions and then threshold the first component \
|
| 89 |
+
to segment the background and foreground. Then, we run the second PCA on the foreground features \
|
| 90 |
+
so we can visualize foreground objects as RGB.
|
| 91 |
+
|
| 92 |
+
[Paper](https://arxiv.org/pdf/2304.07193.pdf)
|
| 93 |
+
[Github](https://github.com/facebookresearch/dinov2)
|
| 94 |
+
|
| 95 |
+
Created by: [Eduardo Pacheco](https://github.com/EduardoPach)
|
| 96 |
+
"""
|
| 97 |
+
)
|
| 98 |
with gr.Row():
|
| 99 |
threshold = gr.Slider(minimum=0, maximum=1, value=0.6, step=0.05, label="Threshold")
|
| 100 |
object_larger_than_bg = gr.Checkbox(label="Object Larger than Background", value=False)
|