Spaces:
Running
on
Zero
Running
on
Zero
JianyuanWang
commited on
Commit
β’
3b22732
1
Parent(s):
c5a094f
commit
Browse files- .gitattributes +2 -0
- app.py +4 -37
- images_to_videos.py +2 -2
- vggsfm_code/examples/bonsai/.DS_Store +0 -0
- vggsfm_code/examples/bonsai/images/DSCF5565.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5568.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5573.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5579.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5582.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5585.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5588.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5590.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5593.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5596.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5600.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5603.JPG +3 -0
- vggsfm_code/examples/bonsai/images/DSCF5615.JPG +3 -0
- vggsfm_code/examples/british_museum/images_10/29057984_287139632.jpg +0 -0
- vggsfm_code/examples/british_museum/images_10/32630292_7166579210.jpg +0 -0
- vggsfm_code/examples/british_museum/{images β images_10}/45839934_4117745134.jpg +0 -0
- vggsfm_code/examples/british_museum/images_10/51004432_567773767.jpg +0 -0
- vggsfm_code/examples/british_museum/{images β images_10}/62620282_3728576515.jpg +0 -0
- vggsfm_code/examples/british_museum/images_10/71931631_7212707886.jpg +0 -0
- vggsfm_code/examples/british_museum/images_10/78600497_407639599.jpg +0 -0
- vggsfm_code/examples/british_museum/{images β images_10}/80340357_5029510336.jpg +0 -0
- vggsfm_code/examples/british_museum/{images β images_10}/81272348_2712949069.jpg +0 -0
- vggsfm_code/examples/british_museum/{images β images_10}/93266801_2335569192.jpg +0 -0
- vggsfm_code/examples/videos/bonsai_video.mp4 +3 -0
- vggsfm_code/examples/videos/british_museum_video.mp4 +0 -0
- vggsfm_code/examples/videos/cake_video.mp4 +0 -0
.gitattributes
CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*.JPG filter=lfs diff=lfs merge=lfs -text
|
37 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -173,51 +173,17 @@ british_museum_video = "vggsfm_code/examples/videos/british_museum_video.mp4"
|
|
173 |
# os.path.join(os.path.dirname(__file__), "british_museum_video.mp4")
|
174 |
cake_video = "vggsfm_code/examples/videos/cake_video.mp4"
|
175 |
|
|
|
|
|
176 |
# os.path.join(os.path.dirname(__file__), "cake_video.mp4")
|
177 |
|
178 |
|
179 |
|
180 |
# apple_images = glob.glob(f'vggsfm_code/examples/apple/images/*')
|
|
|
181 |
cake_images = glob.glob(f'vggsfm_code/examples/cake/images/*')
|
182 |
british_museum_images = glob.glob(f'vggsfm_code/examples/british_museum/images/*')
|
183 |
|
184 |
-
########################################################################################################################
|
185 |
-
# if True:
|
186 |
-
# demo = gr.Interface(
|
187 |
-
# title="π¨ VGGSfM: Visual Geometry Grounded Deep Structure From Motion",
|
188 |
-
# fn=vggsfm_demo,
|
189 |
-
# inputs=[
|
190 |
-
# gr.Video(label="Input video", interactive=True, scale=1),
|
191 |
-
# gr.File(file_count="multiple", label="Input Images", interactive=True, scale=1),
|
192 |
-
# gr.Slider(minimum=1, maximum=10, step=1, value=5, label="Number of query images", scale=1),
|
193 |
-
# gr.Slider(minimum=512, maximum=4096, step=1, value=1024, label="Number of query points", scale=1),
|
194 |
-
# ],
|
195 |
-
# outputs=[
|
196 |
-
# gr.Model3D(label="Reconstruction", scale=10),
|
197 |
-
# gr.Textbox(label="Log", scale=10)
|
198 |
-
# ],
|
199 |
-
# # outputs=[gr.Model3D(label="Reconstruction", scale=3), gr.Textbox(label="Log", )],
|
200 |
-
# examples=[
|
201 |
-
# # [apple_video, apple_images, 5, 2048],
|
202 |
-
# [cake_video, cake_images, 3, 4096],
|
203 |
-
# [british_museum_video, british_museum_images, 2, 4096],],
|
204 |
-
# cache_examples=False,
|
205 |
-
# # allow_flagging=False,
|
206 |
-
# allow_flagging='never', # Updated from False to 'never'
|
207 |
-
# concurrency_limit=1, # Added concurrency_limit to Interface
|
208 |
-
# description = """<div style="text-align: left;">
|
209 |
-
# <p>Welcome to <a href="https://github.com/facebookresearch/vggsfm" target="_blank">VGGSfM</a> demo!
|
210 |
-
# This space demonstrates 3D reconstruction from input image frames. </p>
|
211 |
-
# <p>To get started quickly, you can click on our examples. If you want to reconstruct your own data, simply: </p>
|
212 |
-
# <ul style="display: inline-block; text-align: left;">
|
213 |
-
# <li>upload the images (.jpg, .png, etc.), or </li>
|
214 |
-
# <li>upload a video (.mp4, .mov, etc.) </li>
|
215 |
-
# </ul>
|
216 |
-
# <p>If both images and videos are uploaded, the demo will only reconstruct the uploaded images. By default, we extract one image frame per second from the input video. To prevent crashes on the Hugging Face space, we currently limit reconstruction to the first 20 image frames. </p>
|
217 |
-
# <p>For more details, check our <a href="https://github.com/facebookresearch/vggsfm" target="_blank">GitHub Repo</a> β</p>
|
218 |
-
# <p>(Please note that running reconstruction on Hugging Face space is slower than on a local machine.) </p>
|
219 |
-
# </div>""",
|
220 |
-
# )
|
221 |
|
222 |
with gr.Blocks() as demo:
|
223 |
gr.Markdown("# π¨ VGGSfM: Visual Geometry Grounded Deep Structure From Motion")
|
@@ -258,6 +224,7 @@ with gr.Blocks() as demo:
|
|
258 |
|
259 |
examples = [
|
260 |
[british_museum_video, british_museum_images, 2, 4096],
|
|
|
261 |
[cake_video, cake_images, 3, 2048],
|
262 |
]
|
263 |
|
|
|
173 |
# os.path.join(os.path.dirname(__file__), "british_museum_video.mp4")
|
174 |
cake_video = "vggsfm_code/examples/videos/cake_video.mp4"
|
175 |
|
176 |
+
bonsai_video = "vggsfm_code/examples/videos/bonsai_video.mp4"
|
177 |
+
|
178 |
# os.path.join(os.path.dirname(__file__), "cake_video.mp4")
|
179 |
|
180 |
|
181 |
|
182 |
# apple_images = glob.glob(f'vggsfm_code/examples/apple/images/*')
|
183 |
+
bonsai_images = glob.glob(f'vggsfm_code/examples/bonsai/images/*')
|
184 |
cake_images = glob.glob(f'vggsfm_code/examples/cake/images/*')
|
185 |
british_museum_images = glob.glob(f'vggsfm_code/examples/british_museum/images/*')
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
|
188 |
with gr.Blocks() as demo:
|
189 |
gr.Markdown("# π¨ VGGSfM: Visual Geometry Grounded Deep Structure From Motion")
|
|
|
224 |
|
225 |
examples = [
|
226 |
[british_museum_video, british_museum_images, 2, 4096],
|
227 |
+
[bonsai_video, bonsai_images, 3, 2048],
|
228 |
[cake_video, cake_images, 3, 2048],
|
229 |
]
|
230 |
|
images_to_videos.py
CHANGED
@@ -2,9 +2,9 @@ import cv2
|
|
2 |
import os
|
3 |
|
4 |
# Parameters
|
5 |
-
name = "
|
6 |
folder_path = f'vggsfm_code/examples/{name}/images' # Update with the path to your images
|
7 |
-
video_path = f'{name}_video.mp4'
|
8 |
fps = 1 # frames per second
|
9 |
|
10 |
# Get all image files from the directory
|
|
|
2 |
import os
|
3 |
|
4 |
# Parameters
|
5 |
+
name = "bonsai"
|
6 |
folder_path = f'vggsfm_code/examples/{name}/images' # Update with the path to your images
|
7 |
+
video_path = f'vggsfm_code/examples/videos/{name}_video.mp4'
|
8 |
fps = 1 # frames per second
|
9 |
|
10 |
# Get all image files from the directory
|
vggsfm_code/examples/bonsai/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
vggsfm_code/examples/bonsai/images/DSCF5565.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5568.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5573.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5579.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5582.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5585.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5588.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5590.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5593.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5596.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5600.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5603.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/bonsai/images/DSCF5615.JPG
ADDED
Git LFS Details
|
vggsfm_code/examples/british_museum/images_10/29057984_287139632.jpg
ADDED
vggsfm_code/examples/british_museum/images_10/32630292_7166579210.jpg
ADDED
vggsfm_code/examples/british_museum/{images β images_10}/45839934_4117745134.jpg
RENAMED
File without changes
|
vggsfm_code/examples/british_museum/images_10/51004432_567773767.jpg
ADDED
vggsfm_code/examples/british_museum/{images β images_10}/62620282_3728576515.jpg
RENAMED
File without changes
|
vggsfm_code/examples/british_museum/images_10/71931631_7212707886.jpg
ADDED
vggsfm_code/examples/british_museum/images_10/78600497_407639599.jpg
ADDED
vggsfm_code/examples/british_museum/{images β images_10}/80340357_5029510336.jpg
RENAMED
File without changes
|
vggsfm_code/examples/british_museum/{images β images_10}/81272348_2712949069.jpg
RENAMED
File without changes
|
vggsfm_code/examples/british_museum/{images β images_10}/93266801_2335569192.jpg
RENAMED
File without changes
|
vggsfm_code/examples/videos/bonsai_video.mp4
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:627cba512d70ff1ead2ba23e9e8492104934c42c6f2263665d39b72b24ea4d82
|
3 |
+
size 2107907
|
vggsfm_code/examples/videos/british_museum_video.mp4
CHANGED
Binary files a/vggsfm_code/examples/videos/british_museum_video.mp4 and b/vggsfm_code/examples/videos/british_museum_video.mp4 differ
|
|
vggsfm_code/examples/videos/cake_video.mp4
CHANGED
Binary files a/vggsfm_code/examples/videos/cake_video.mp4 and b/vggsfm_code/examples/videos/cake_video.mp4 differ
|
|