JianyuanWang commited on
Commit
3b22732
β€’
1 Parent(s): c5a094f
Files changed (30) hide show
  1. .gitattributes +2 -0
  2. app.py +4 -37
  3. images_to_videos.py +2 -2
  4. vggsfm_code/examples/bonsai/.DS_Store +0 -0
  5. vggsfm_code/examples/bonsai/images/DSCF5565.JPG +3 -0
  6. vggsfm_code/examples/bonsai/images/DSCF5568.JPG +3 -0
  7. vggsfm_code/examples/bonsai/images/DSCF5573.JPG +3 -0
  8. vggsfm_code/examples/bonsai/images/DSCF5579.JPG +3 -0
  9. vggsfm_code/examples/bonsai/images/DSCF5582.JPG +3 -0
  10. vggsfm_code/examples/bonsai/images/DSCF5585.JPG +3 -0
  11. vggsfm_code/examples/bonsai/images/DSCF5588.JPG +3 -0
  12. vggsfm_code/examples/bonsai/images/DSCF5590.JPG +3 -0
  13. vggsfm_code/examples/bonsai/images/DSCF5593.JPG +3 -0
  14. vggsfm_code/examples/bonsai/images/DSCF5596.JPG +3 -0
  15. vggsfm_code/examples/bonsai/images/DSCF5600.JPG +3 -0
  16. vggsfm_code/examples/bonsai/images/DSCF5603.JPG +3 -0
  17. vggsfm_code/examples/bonsai/images/DSCF5615.JPG +3 -0
  18. vggsfm_code/examples/british_museum/images_10/29057984_287139632.jpg +0 -0
  19. vggsfm_code/examples/british_museum/images_10/32630292_7166579210.jpg +0 -0
  20. vggsfm_code/examples/british_museum/{images β†’ images_10}/45839934_4117745134.jpg +0 -0
  21. vggsfm_code/examples/british_museum/images_10/51004432_567773767.jpg +0 -0
  22. vggsfm_code/examples/british_museum/{images β†’ images_10}/62620282_3728576515.jpg +0 -0
  23. vggsfm_code/examples/british_museum/images_10/71931631_7212707886.jpg +0 -0
  24. vggsfm_code/examples/british_museum/images_10/78600497_407639599.jpg +0 -0
  25. vggsfm_code/examples/british_museum/{images β†’ images_10}/80340357_5029510336.jpg +0 -0
  26. vggsfm_code/examples/british_museum/{images β†’ images_10}/81272348_2712949069.jpg +0 -0
  27. vggsfm_code/examples/british_museum/{images β†’ images_10}/93266801_2335569192.jpg +0 -0
  28. vggsfm_code/examples/videos/bonsai_video.mp4 +3 -0
  29. vggsfm_code/examples/videos/british_museum_video.mp4 +0 -0
  30. 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 = "british_museum"
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

  • SHA256: 78cc33c4002108cc825ccc63d513dbcce5d9cc34b3c141d20a063eb1e59d238c
  • Pointer size: 131 Bytes
  • Size of remote file: 986 kB
vggsfm_code/examples/bonsai/images/DSCF5568.JPG ADDED

Git LFS Details

  • SHA256: d312dc1da67a86e6aba6ab4c2982e36caa9e3b5e3c6566ea2145ac55ce82dd29
  • Pointer size: 131 Bytes
  • Size of remote file: 959 kB
vggsfm_code/examples/bonsai/images/DSCF5573.JPG ADDED

Git LFS Details

  • SHA256: 0f82cbb82a98765392524b344ea12ff9229194856fcab7f56410fdc1b3889cc1
  • Pointer size: 132 Bytes
  • Size of remote file: 1.01 MB
vggsfm_code/examples/bonsai/images/DSCF5579.JPG ADDED

Git LFS Details

  • SHA256: f7c1a33aed162f729fa62f0e3492eb0fb99aa6108502ff76707debd1d8c13010
  • Pointer size: 131 Bytes
  • Size of remote file: 985 kB
vggsfm_code/examples/bonsai/images/DSCF5582.JPG ADDED

Git LFS Details

  • SHA256: 1658f47aa29db57e36af32964e20fab7e88f5fa5fa08c3f488ba2a4bb3102e87
  • Pointer size: 131 Bytes
  • Size of remote file: 986 kB
vggsfm_code/examples/bonsai/images/DSCF5585.JPG ADDED

Git LFS Details

  • SHA256: 74d76aa963a544e934f8f425748725a44cf1dd821ea429b8bc4de7f54e64f01f
  • Pointer size: 131 Bytes
  • Size of remote file: 995 kB
vggsfm_code/examples/bonsai/images/DSCF5588.JPG ADDED

Git LFS Details

  • SHA256: 12c86c1bc77dfca6d85e212371c1a4492ff33c88dd94b3093914be53f9086719
  • Pointer size: 131 Bytes
  • Size of remote file: 959 kB
vggsfm_code/examples/bonsai/images/DSCF5590.JPG ADDED

Git LFS Details

  • SHA256: 39d2181615ad8a10a0c9690da521ba52f57f47dde56e88f10a2192aec1f99339
  • Pointer size: 131 Bytes
  • Size of remote file: 984 kB
vggsfm_code/examples/bonsai/images/DSCF5593.JPG ADDED

Git LFS Details

  • SHA256: a0215ddb43f159cdfe17acef09c93ac3a6395afb607be7d037aa8083dffc02e5
  • Pointer size: 132 Bytes
  • Size of remote file: 1.01 MB
vggsfm_code/examples/bonsai/images/DSCF5596.JPG ADDED

Git LFS Details

  • SHA256: 4d5d4d140e8c7dd9314044a01c31b95f254db9946a7925cc2e54b1ddc4b273b8
  • Pointer size: 132 Bytes
  • Size of remote file: 1.02 MB
vggsfm_code/examples/bonsai/images/DSCF5600.JPG ADDED

Git LFS Details

  • SHA256: 2ce45967c1d76a068352fc8c36134381a1f5f5a5034d1910ab30e573d3a2150f
  • Pointer size: 132 Bytes
  • Size of remote file: 1.03 MB
vggsfm_code/examples/bonsai/images/DSCF5603.JPG ADDED

Git LFS Details

  • SHA256: b66c1e0a16acdbcc8277e0b8daff7c1c1a44ed3cf0d41e29f3fb2eec1436b256
  • Pointer size: 132 Bytes
  • Size of remote file: 1 MB
vggsfm_code/examples/bonsai/images/DSCF5615.JPG ADDED

Git LFS Details

  • SHA256: faf2a28356aa19c36ede7f2ee9d4da012fe4ef9fb2fddf367c150f3fb0668c59
  • Pointer size: 131 Bytes
  • Size of remote file: 991 kB
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