Skip to content

Commit

Permalink
Merge pull request #1110 from DLR-RM/pip_package_update
Browse files Browse the repository at this point in the history
chore(pip): Updates default pip packages
  • Loading branch information
cornerfarmer authored Jun 19, 2024
2 parents ce53a2b + 1a3bd7d commit 3a7b078
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions blenderproc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
if sys.version_info.major < 3:
raise Exception("BlenderProc requires at least python 3.X to run.")

# exr is now disabled by default (see https://github.com/opencv/opencv/issues/21326)
os.environ["OPENCV_IO_ENABLE_OPENEXR"] = "1"

# Only import if we are in the blender environment, this environment variable is set by the cli.py script
if "INSIDE_OF_THE_INTERNAL_BLENDER_PYTHON_ENVIRONMENT" in os.environ:
# Remove the parent of the blender proc folder, as it might contain other packages
Expand Down
4 changes: 2 additions & 2 deletions blenderproc/python/utility/BlenderUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def load_image(file_path: str, num_channels: int = 3) -> np.ndarray:
file_ending = file_path[file_path.rfind(".") + 1:].lower()
if file_ending in ["exr", "png"]:
try:
return imageio.imread(file_path)[:, :, :num_channels]
return imageio.v3.imread(file_path, plugin='opencv', flags=cv2.IMREAD_UNCHANGED)[:, :, :num_channels]
except ValueError:
print("It seems the freeimage library which is necessary to read .exr files cannot "
"be found on your computer.")
Expand All @@ -172,7 +172,7 @@ def load_image(file_path: str, num_channels: int = 3) -> np.ndarray:

try:
# Try again
return imageio.imread(file_path)[:, :, :num_channels]
return imageio.v3.imread(file_path, plugin='opencv', flags=cv2.IMREAD_UNCHANGED)[:, :, :num_channels]
except ValueError as e2:
error = "The automatic installation of the freeimage library failed, so you need to install " \
"the imageio .exr extension manually. This is quite simple: \n"
Expand Down
8 changes: 4 additions & 4 deletions blenderproc/python/utility/DefaultConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class DefaultConfig:
world_background = [0.05, 0.05, 0.05]

# Setup
default_pip_packages = ["wheel", "pyyaml==5.1.2", "imageio==2.9.0", "gitpython==3.1.18",
"scikit-image==0.19.2", "pypng==0.0.20", "scipy==1.11.3", "matplotlib==3.5.1",
"pytz==2021.1", "h5py==3.6.0", "Pillow==8.3.2", "opencv-contrib-python==4.5.5.64",
"scikit-learn==1.0.2", "python-dateutil==2.8.2", "rich==12.6.0", "trimesh==3.21.5",
default_pip_packages = ["wheel", "pyyaml==6.0.1", "imageio==2.34.1", "gitpython==3.1.43",
"scikit-image==0.23.2", "pypng==0.20220715.0", "scipy==1.13.1", "matplotlib==3.9.0",
"pytz==2024.1", "h5py==3.11.0", "Pillow==10.3.0", "opencv-contrib-python==4.10.0.82",
"scikit-learn==1.5.0", "python-dateutil==2.9.0.post0", "rich==13.7.1", "trimesh==4.4.0",
"pyrender==0.1.45"]

0 comments on commit 3a7b078

Please sign in to comment.