nerfstudio icon indicating copy to clipboard operation
nerfstudio copied to clipboard

Metashape converter

Open Hertsberg opened this issue 2 years ago • 8 comments

When try to convert the XML metashape file I get the next result:

(nerfstudio) PS C:\Users\serge> ns-process-data metashape --data nerfstudio\data\nerfstudio\Pieta --xml Pieta.xml --output-dir nerfstudio\data\nerfstudio\Pieta Traceback (most recent call last): File "C:\Users\serge\miniconda3\envs\nerfstudio\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\serge\miniconda3\envs\nerfstudio\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\serge\miniconda3\envs\nerfstudio\Scripts\ns-process-data.exe_main.py", line 7, in File "C:\Users\serge\nerfstudio\nerfstudio\scripts\process_data.py", line 493, in entrypoint tyro.cli(Commands).main() File "C:\Users\serge\nerfstudio\nerfstudio\scripts\process_data.py", line 264, in main copied_image_paths = process_data_utils.copy_images_list( File "C:\Users\serge\nerfstudio\nerfstudio\process_data\process_data_utils.py", line 298, in copy_images_list ffmpeg_cmd = f'ffmpeg -y -noautorotate -i "{image_dir / f"{framename}{copied_image_paths[0].suffix}"}" -q:v 2 ' IndexError: list index out of range

I don't know what to do, has the same thing happened to anyone?

Hertsberg avatar Nov 17 '23 14:11 Hertsberg

hi is your xml file coming from metashape ? I mean did you have exported that xml from metashape ? 1/ load project into metashape 2/ file > export > camera in xml file

please also check your "link" to your source photos into metashape. Check their path inside metashape.

put your absolute path when mentionning the xml path in the command

antoinebio avatar Nov 17 '23 17:11 antoinebio

Hello Antoine, thanks for the answer. Yes, i'm using an xml file export directly from metashape. I Will try the absolut path thing that You mention.

Regards

El vie, 17 de nov de 2023, 11:46 a. m., antoine @.***> escribió:

hi is your xml file coming from metashape ? I mean did you have exported that xml from metashape ? 1/ load project into metashape 2/ file > export > camera in xml file

please also check your "link" to your source photos into metashape. Check their path inside metashape.

put your absolute path when mentionning the xml path in the command

— Reply to this email directly, view it on GitHub https://github.com/nerfstudio-project/nerfstudio/issues/2618#issuecomment-1816841973, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEBOOCDMPOII63HNCHZE6MLYE6PIXAVCNFSM6AAAAAA7P47LFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJWHA2DCOJXGM . You are receiving this because you authored the thread.Message ID: @.***>

Hertsberg avatar Nov 17 '23 18:11 Hertsberg

Still nothing:

(nerfstudio) PS C:\Users\serge> ns-process-data metashape --data C:\users\serge\nerfstudio\data\nerfstudio\Pieta --xml Pieta.xml --output-dir C:\users\serge\nerfstudio\data\nerfstudio\Pieta Traceback (most recent call last): File "C:\Users\serge\miniconda3\envs\nerfstudio\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\serge\miniconda3\envs\nerfstudio\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\serge\miniconda3\envs\nerfstudio\Scripts\ns-process-data.exe_main.py", line 7, in File "C:\Users\serge\nerfstudio\nerfstudio\scripts\process_data.py", line 493, in entrypoint tyro.cli(Commands).main() File "C:\Users\serge\nerfstudio\nerfstudio\scripts\process_data.py", line 264, in main copied_image_paths = process_data_utils.copy_images_list( File "C:\Users\serge\nerfstudio\nerfstudio\process_data\process_data_utils.py", line 298, in copy_images_list ffmpeg_cmd = f'ffmpeg -y -noautorotate -i "{image_dir / f"{framename}{copied_image_paths[0].suffix}"}" -q:v 2 ' IndexError: list index out of range

Hertsberg avatar Nov 17 '23 22:11 Hertsberg

I made some arregments and now I have this:

(nerfstudio) PS C:\Users\serge> ns-process-data metashape --data C:\Users\serge\nerfstudio\data\nerfstudio\Pieta\images --xml Pieta.xml --output-dir C:\Users\serge\nerfstudio\data\nerfstudio\Pieta ────────────────────────────────────────────── 💀 💀 💀 ERROR 💀 💀 💀 ─────────────────────────────────────────────── Error running command: ffmpeg -y -noautorotate -i "C:\Users\serge\nerfstudio\data\nerfstudio\Pieta\images\frame_%05d.jpg" -q:v 2 -filter_complex "[0:v]split=4;scale=iw/1:ih/1;scale=iw/2:ih/2;scale=iw/4:ih/4;scale=iw/8:ih/8" -map "" "C:\Users\serge\nerfstudio\data\nerfstudio\Pieta\images\frame_%05d.jpg" -map "" "C:\Users\serge\nerfstudio\data\nerfstudio\Pieta\images_2\frame_%05d.jpg" -map "" "C:\Users\serge\nerfstudio\data\nerfstudio\Pieta\images_4\frame_%05d.jpg" -map "" "C:\Users\serge\nerfstudio\data\nerfstudio\Pieta\images_8\frame_%05d.jpg" ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── "ffmpeg" no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable.

Hertsberg avatar Nov 17 '23 22:11 Hertsberg

OK, I think I made a little step foward:

nerfstudio) PS C:\Users\serge> ns-process-data metashape --data C:\users\serge\nerfstudio\data\nerfstudio\Pieta\images --xml Pieta.xml --output-dir C:\users\serge\nerfstudio\data\nerfstudio\Pieta [18:33:26] 🎉 Done copying images with prefix 'frame_'. process_data_utils.py:329 Traceback (most recent call last): File "C:\Users\serge\miniconda3\envs\nerfstudio\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\serge\miniconda3\envs\nerfstudio\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\serge\miniconda3\envs\nerfstudio\Scripts\ns-process-data.exe_main.py", line 7, in File "C:\Users\serge\nerfstudio\nerfstudio\scripts\process_data.py", line 493, in entrypoint tyro.cli(Commands).main() File "C:\Users\serge\nerfstudio\nerfstudio\scripts\process_data.py", line 290, in main metashape_utils.metashape_to_json( File "C:\Users\serge\nerfstudio\nerfstudio\process_data\metashape_utils.py", line 53, in metashape_to_json xml_tree = ET.parse(xml_filename) File "C:\Users\serge\miniconda3\envs\nerfstudio\lib\xml\etree\ElementTree.py", line 1202, in parse tree.parse(source, parser) File "C:\Users\serge\miniconda3\envs\nerfstudio\lib\xml\etree\ElementTree.py", line 584, in parse source = open(source, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'Pieta.xml'

Don't understand why there is no file or directory

Hertsberg avatar Nov 18 '23 00:11 Hertsberg

Oh! My! Success! To solve the issue I had to install ffmpeg, once done all I had to to was to give the absolute path for the xml file as well.

Thanks to Antoine for the hint.

Hertsberg avatar Nov 18 '23 00:11 Hertsberg

I have the same problem as you but I still haven't solved the solution

C:\Users\USER>ns-process-data metashape --data C:\Users\USER\data\nerfstudio\drone --xml C:\Users\USER\data\nerfstudio\drone\drone.xml --output-dir C:\Users\USER\data\nerfstudio\output_drone Traceback (most recent call last): File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\Scripts\ns-process-data.exe_main.py", line 7, in File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\lib\site-packages\nerfstudio\scripts\process_data.py", line 404, in entrypoint tyro.cli(Commands).main() File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\lib\site-packages\nerfstudio\scripts\process_data.py", line 263, in main copied_image_paths = process_data_utils.copy_images_list( File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\lib\site-packages\nerfstudio\process_data\process_data_utils.py", line 298, in copy_images_list ffmpeg_cmd = f'ffmpeg -y -noautorotate -i "{image_dir / f"{framename}{copied_image_paths[0].suffix}"}" -q:v 2 ' IndexError: list index out of range

I don't know what to do, has the same thing happened to anyone?

riyassyamsularif avatar Jan 12 '24 12:01 riyassyamsularif

I have the same problem as you but I still haven't solved the solution

C:\Users\USER>ns-process-data metashape --data C:\Users\USER\data\nerfstudio\drone --xml C:\Users\USER\data\nerfstudio\drone\drone.xml --output-dir C:\Users\USER\data\nerfstudio\output_drone Traceback (most recent call last): File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\lib\runpy.py", line 194, in _run_module_as_main return run_code(code, main_globals, None, File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\Scripts\ns-process-data.exe__main.py", line 7, in File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\lib\site-packages\nerfstudio\scripts\process_data.py", line 404, in entrypoint tyro.cli(Commands).main() File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\lib\site-packages\nerfstudio\scripts\process_data.py", line 263, in main copied_image_paths = process_data_utils.copy_images_list( File "C:\Users\USER\anaconda3\envs\nerfstudio_rys\lib\site-packages\nerfstudio\process_data\process_data_utils.py", line 298, in copy_images_list ffmpeg_cmd = f'ffmpeg -y -noautorotate -i "{image_dir / f"{framename}{copied_image_paths[0].suffix}"}" -q:v 2 ' IndexError: list index out of range

I don't know what to do, has the same thing happened to anyone?

hi @riyassyamsularif have you installed imagemagick or colmap package ? please check it as explained here > https://github.com/nerfstudio-project/nerfstudio/issues/2427

antoinebio avatar Jan 12 '24 16:01 antoinebio