ArthurBrussee / brush

3D Reconstruction for all
Apache License 2.0
214 stars 4 forks source link

Ability to read from directories instead of .zip files when possible. #1

Open AsherJingkongChen opened 13 hours ago

AsherJingkongChen commented 13 hours ago

Problem

We are working with a ZIP file containing several entries, including images and a sparse folder with camera data. Here’s a sample of the ZIP’s contents:

   411837  04-13-2023 16:37   train/images/00300.jpg
   429686  04-13-2023 16:37   train/images/00301.jpg
        0  07-04-2023 16:55   train/sparse/
        0  07-04-2023 16:57   train/sparse/0/
       64  04-13-2023 16:33   train/sparse/0/cameras.bin

However, the COLMAP reader is unable to locate files like sparse/0/cameras.bin and potentially other entries.

Question

What’s the best way to resolve this? Should we try to match against the regular expression .*sparse/0/cameras.bin for all entries in the ZIP?

Concern

I'm unsure if reading from arbitrary ZIP files using this approach is reliable long-term. Are there any more stable methods for handling this?

ArthurBrussee commented 13 hours ago

Yeah the format is very finnicky currently - the folder needs to contain exactly an ./images and ./sparse folder. Adding some method to search for the sparse folder should help! The nerf_synthetic reader does already do this.

I agree though it's generally terrible to use a .zip for this, you should be able to just read a directory. I've done it like this so far because it's harder on WASM and Android to open directories.

ArthurBrussee commented 8 hours ago

I've added some fixes so this should be more robust, and eg. a top level directory in a zip file should be ok now.

Will leave this issue open & change it to say opening normal directories should work