Blenderproc: HDR(I) Backgrounds - File is not a zip file - Haven Dataset

Created on 21 Jun 2021  ยท  8Comments  ยท  Source: DLR-RM/BlenderProc

Hello together,

I want to have HDRI Backgrounds in my Dataset. I found out about the haven Dataset where HDR Images were used as backgrounds.

I followed the instructions and tried to download the Haven Dataset via python scripts/download_haven.py
After executing the program I got an error saying:

Traceback (most recent call last):
  File "scripts/download_haven.py", line 76, in <module>
    download_items("https://texturehaven.com/textures/", output_dir / "textures", download_texture)
  File "scripts/download_haven.py", line 45, in download_items
    item_download_func(item_id, item_output)
  File "scripts/download_haven.py", line 51, in download_texture
    with zipfile.ZipFile(BytesIO(request.content)) as tar:
  File "/Users/user/opt/anaconda3/lib/python3.8/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/Users/user/opt/anaconda3/lib/python3.8/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

Somehow it managed to download all files as .jpg but when executing my program with the loader.HavenEnvironmentLoader module I get the following Error:
Exception: The folder: resources/haven/hdris does not contain a folder name hdfris. Please use the download script.

Thank you for any help! :)

question first answer provided

All 8 comments

Hey,

just to be sure that you offered the right path you need to provide the path to a folder in which a folder exists with the name hdris, which has the following structure:

hdris/
โ”œโ”€โ”€ abandoned_church
โ”‚ย ย  โ””โ”€โ”€ abandoned_church_2k.hdr
โ”œโ”€โ”€ abandoned_factory_canteen_01
โ”‚ย ย  โ””โ”€โ”€ abandoned_factory_canteen_01_2k.hdr
โ”œโ”€โ”€ abandoned_factory_canteen_02
โ”‚ย ย  โ””โ”€โ”€ abandoned_factory_canteen_02_2k.hdr
โ”œโ”€โ”€ abandoned_games_room_01
โ”‚ย ย  โ””โ”€โ”€ abandoned_games_room_01_2k.hdr
โ”œโ”€โ”€ abandoned_games_room_02
โ”‚ย ย  โ””โ”€โ”€ abandoned_games_room_02_2k.hdr
โ”œโ”€โ”€ abandoned_hall_01

Is that the case?

Best,
Max

When executing the python scripts/download_haven.py it only downloaded a folder saying "textures" with all the .jpg Images inside.
I sadly have no .hdr files at all...

I just restarted the download process, it first downloads the textures and afterwards the hdris.

Can you remove the resources/haven folder and try again?

Make sure that your BlenderProc github repo is on the newest version and that you haven't changed the download_script.

Yeah I tried deleting it and download it again but I always get an error saying File is not a zip file, I also have the latest version of BlenderProc and I also didn't changed the download_script...
But I found a workaround. I can just download any kind of HDR file and put it in the structure you provided above.
That is just a litte more effort but you can now use any HDR file you want to :)

Thank you for the Help!
Kind regards,
Tobi

It seems that your system doesn't download the zip file. This is hard to debug from here, you can print the following url:

https://github.com/DLR-RM/BlenderProc/blob/8bc933868c2284982ad2aa091358429c02d8842d/scripts/download_haven.py#L48

And try to download it by hand. Are you behind a proxy, which might be blocked by texturehaven?

Best,
Max

Then I will do it by hand thank you!

I don't think I am but to be honest I don't really know. Maybe Apple is blocking something there (I am working on Mac) and just doesn't allow zip files to be unzipped or anything...

If anyone else has the same problem, we will have to investigate this further, but at the moment I will call this issue closed.

Yeah me too! Thank you for your Help :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wangg12 picture wangg12  ยท  3Comments

soans1994 picture soans1994  ยท  5Comments

b-yogesh picture b-yogesh  ยท  3Comments

manuelli picture manuelli  ยท  3Comments

mikkeljakobsen picture mikkeljakobsen  ยท  6Comments