Florian-Barthel / splatviz

Full python interactive 3D Gaussian Splatting viewer for real-time editing and analyzing.
MIT License
1.03k stars 68 forks source link

Image decoding fails #20

Open DuVogel87 opened 1 month ago

DuVogel87 commented 1 month ago

Hello Florian.

When i run python run_main.py it get this in the terminal:

(gs-view) C:\Splatviz\splatviz>python run_main.py

Traceback (most recent call last): File "C:\Splatviz\splatviz\viz\base_renderer.py", line 26, in render self._render_impl(res, **args) File "C:\Splatviz\splatviz\viz\gaussian_renderer.py", line 53, in _render_impl self.gaussian_models[scene_index] = run_single_decompression(Path(ply_file_path).parent.absolute()) File "C:\Splatviz\splatviz\compression\compression_exp.py", line 65, in run_single_decompression decompress_attr( File "C:\Splatviz\splatviz\compression\compression_exp.py", line 41, in decompress_attr decompressed_attr = codec.decode_with_normalization(compressed_file, min_val, max_val) File "C:\Splatviz\splatviz\compression\codec.py", line 78, in decode_with_normalization img_norm = self.decode(file_name) File "C:\Splatviz\splatviz\compression\codec.py", line 70, in decode return self.decode_image(image) File "C:\Splatviz\splatviz\compression\jpeg_xl.py", line 12, in decode_image return imagecodecs.imread(file_name) File "C:\Users\Neo\anaconda3\envs\gs-view\lib\site-packages\imagecodecs\imagecodecs.py", line 1490, in imread raise ValueError('\n'.join(exceptions)) ValueError: TIFF_DECODE: Not a TIFF or MDI file, bad magic number 2815 (0xaff) PNG_DECODE: not a PNG image GIF_DECODE: DGifCloseFile returned 'Data is not in GIF format' WEBP_DECODE: WebPDemux returned NULL JPEG8_DECODE: Not a JPEG file: starts with 0xff 0x0a LJPEG_DECODE: lj92_open returned LJ92_ERROR_CORRUPT JPEG2K_DECODE: not a J2K or JP2 data stream JPEGLS_DECODE: charls_jpegls_decoder_read_header returned Invalid JPEG-LS stream: first JPEG marker is not a Start Of Image (SOI) marker JPEGXR_DECODE: PKCodecFactory_CreateDecoderFromBytes returned WMP_errUnsupportedFormat AVIF_DECODE: avifDecoderParse returned 'BMFF parsing failed' BMP_DECODE: invalid file header b'\xff\n' ZFP_DECODE: zfp_read_header failed LERC_DECODE: lerc_getBlobInfo returned Failed RGBE_DECODE: no rgbe header found NUMPY_DECODE: not a numpy array

The viewer itself opens. Screenshot: splatviz screenshot

The truck demo is not visible.

Also when i click the "Browse 1" button, i can not navigate into another directory.

Thanks for the help.

Florian-Barthel commented 1 month ago

Hi, i have not seen this error message before. Possibly reinstalling the env could solve the problem.

The Browse 1 button lists all ply files of a defined directory and all its subdirectories. Per default, if you dont provide any parameters, this directory is set to _/samplescenes, which contains the compressed truck. If you change this path to a higher directory you shold see a longer list of available ply files.

python run_main.py --data_path=path/with/plys

Can you change this path and test if normal .ply files are working?

Florian-Barthel commented 1 month ago

You could also download other compressed scenes from here: https://drive.google.com/drive/folders/1RNMis5ibSrl2a87ZX614ZPsHKaY6ams6

Possibly its not because of the library, and instead because of the compressed truck files.

leilei0330 commented 1 month ago

Hi, i have not seen this error message before. Possibly reinstalling the env could solve the problem.

The Browse 1 button lists all ply files of a defined directory and all its subdirectories. Per default, if you dont provide any parameters, this directory is set to _/samplescenes, which contains the compressed truck. If you change this path to a higher directory you shold see a longer list of available ply files.

python run_main.py --data_path=path/with/plys

Can you change this path and test if normal .ply files are working?

Hello, thank you very much for your work, I reinstalled env twice and still have the same error as above, do you know how to fix it

Florian-Barthel commented 1 month ago

Hello, thank you very much for your work, I reinstalled env twice and still have the same error as above, do you know how to fix it

Have you tried if it works with other files, downloaded from https://drive.google.com/drive/folders/1RNMis5ibSrl2a87ZX614ZPsHKaY6ams6 ?

cgohlke commented 1 month ago

JPEG8_DECODE: Not a JPEG file: starts with 0xff 0x0a

The file is a JPEG XL image and imagecodecs was built without the JPEGXL codec.

w-m commented 1 month ago

I saw this problem (conda imagecodecs v2024.6 having no JPEG XL support) before. It worked with version 2023.9.1, but I don’t remember whether it was a conda or pip version.

@Florian-Barthel try changing the imagecodecs version to 2023.9.1 in environment.yml. And if it still doesn’t work, it needs to be moved to the pip section.

w-m commented 1 month ago

Or maybe @cgohlke has a suggestion for what imagecodecs version to use in conda environment.yml that supports JPEG XL 😄

Florian-Barthel commented 1 month ago

I saw this problem (conda imagecodecs v2024.6 having no JPEG XL support) before. It worked with version 2023.9.1, but I don’t remember whether it was a conda or pip version.

@Florian-Barthel try changing the imagecodecs version to 2023.9.1 in environment.yml. And if it still doesn’t work, it needs to be moved to the pip section.

I can't seem to find a version 2023.9.1. I moved the 2024.6 installation to pip. I think this should solve this.

w-m commented 1 month ago

pip requires a full YYYY.M.D version. Specifying this to 2024.6.1 doesn't do anything on my machine (Ubuntu 22.04), as conda had already installed this version as a dependent of scikit-image.

Commit b5e118 moves scikit-image to pip in environment.yml, and specifies a full pip version. Needs to be tested on Windows.