Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: integer cast issue for colored projector patterns #995

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

beekama
Copy link
Contributor

@beekama beekama commented Oct 21, 2023

When calling pattern.ravel(), there is an issue with integer casting, which results in the array values being cast from floats to integers. As a result, the end values are either 0 or 1, leading to the loss of color information and, consequently, the creation of an incorrect result image with only the color values cyan, yellow, and magenta.

@cla-bot
Copy link

cla-bot bot commented Oct 21, 2023

For contributing to BlenderProc you need to sign our Contributor License Agreement. As an individual please sign CLA_individuals.pdf, as a company please sign CLA_entities.pdf and send it to blenderproc@dlr.de

Co-authored-by: Dominik Winkelbauer <dominik.winkelbauer@outlook.de>
@cla-bot cla-bot bot added the cla-signed label Oct 24, 2023
@cornerfarmer
Copy link
Member

cornerfarmer commented Oct 24, 2023

BlenderProcHelper result for run 541:

Done with: [amass_human_poses_python 43s, auto_shading_python 10s, basic_python 11s, blenderkit_python 19s, bop_object_on_surface_sampling_python 79s, bop_object_physics_positioning_python 105s, bop_object_pose_sampling_python 42s, bop_scene_replication_python 166s, camera_depth_of_field_python 18s, camera_object_pose_python 16s, camera_random_trajectories_python 50s, camera_sampling_python 20s, coco_annotations_python 14s, diffuse_color_image_python 18s, dust_python 29s, entity_displacement_modifier_python 14s, entity_manipulation_python 11s, front_3d_object_sampling_python 83s, front_3d_python 98s, front_3d_with_improved_mat_python 102s, git_log 1s, haven_python 23s, ikea_python 18s, kinect_azure_noise_python 14s, lens_distortion_python 15s, lens_distortion_python 13s, light_sampling_python 12s, material_manipulation_python 10s, material_randomizer_python 13s, matterport3d_python 69s, motion_blur_rolling_shutter_python 31s, motion_blur_rolling_shutter_python 21s, multi_render_python 245s, nocs_python 18s, object_pose_sampling_python 11s, on_surface_object_sampling_python 11s, optical_flow_python 25s, physics_convex_decomposition_python 133s, physics_positioning_python 24s, pix3d_python 17s, random_backgrounds_python 17s, random_room_constructor_python 75s, replica_python 337s, scenenet_python 51s, scenenet_with_cctextures_python 53s, semantic_segmentation_python 14s, shapenet_python 19s, shapenet_with_scenenet_python 52s, shapenet_with_suncg_python 68s, spotlight_python 46s, stereo_matching_python 42s, stereo_matching_with_projector_python 136s, suncg_basic_python 32s, suncg_with_cam_sampling_python 56s, suncg_with_improved_mat_python 74s, suncg_with_object_replacer_python 60s, tests_python 15s, urdf_loading_and_manipulation_python 50s]
Done with 58 of 58 tests.
There were errors:
Unit tests output:

${INTERNAL_NODES_DISC_SPACE}/Dominik_Winkelbauer/blender/blender-3.5.1-linux-x64/3.5/python/lib/python3.10/site-packages/numpy/core/getlimits.py:500: UserWarning: The value of the smallest subnormal for <class 'numpy.float64'> type is zero.
  setattr(self, word, getattr(machar, word).flat[0])
${INTERNAL_NODES_DISC_SPACE}/Dominik_Winkelbauer/blender/blender-3.5.1-linux-x64/3.5/python/lib/python3.10/site-packages/numpy/core/getlimits.py:89: UserWarning: The value of the smallest subnormal for <class 'numpy.float64'> type is zero.
  return self._float_to_str(self.smallest_subnormal)
${INTERNAL_NODES_DISC_SPACE}/Dominik_Winkelbauer/blender/blender-3.5.1-linux-x64/3.5/python/lib/python3.10/site-packages/numpy/core/getlimits.py:500: UserWarning: The value of the smallest subnormal for <class 'numpy.float32'> type is zero.
  setattr(self, word, getattr(machar, word).flat[0])
${INTERNAL_NODES_DISC_SPACE}/Dominik_Winkelbauer/blender/blender-3.5.1-linux-x64/3.5/python/lib/python3.10/site-packages/numpy/core/getlimits.py:89: UserWarning: The value of the smallest subnormal for <class 'numpy.float32'> type is zero.
  return self._float_to_str(self.smallest_subnormal)
...........
----------------------------------------------------------------------
Ran 11 tests in 9.293s

OK

urdf_loading_and_manipulation (main_python)

The output of urdf_loading_and_manipulation:main_python:000000_scene_gt_info_json has changed:

Expand
+ root['2'][3]['px_count_visib']: 2025
- root['2'][3]['px_count_visib']: 2038
+ root['3'][3]['px_count_visib']: 1898
- root['3'][3]['px_count_visib']: 1909
+ root['4'][6]['bbox_visib'][3]: 17
- root['4'][6]['bbox_visib'][3]: 16

The output of urdf_loading_and_manipulation:main_python:000000_scene_gt_coco_json has changed:

Expand
+ root['annotations'][19]['area']: 2025
- root['annotations'][19]['area']: 2038
+ root['annotations'][27]['area']: 1898
- root['annotations'][27]['area']: 1909

stereo_matching (main_python)

The output of stereo_matching:main_python:disparity has changed: Diff: 0.0320, Pixel diff: 0.0047



Compare image Newly generated image

The output of stereo_matching:main_python:disparity has changed: Diff: 0.0224, Pixel diff: 0.0097



Compare image Newly generated image

Pylint output

Expand

Messages

Module blenderproc.python.loader.CCMaterialLoader (blenderproc/python/loader/CCMaterialLoader.py)

Line Col. Type Symbol ID Obj Message
72 0 convention line-too-long C0301
Line too long (152/120)

Module blenderproc.python.types.LightUtility (blenderproc/python/types/LightUtility.py)

Line Col. Type Symbol ID Obj Message
125 12 refactor consider-using-augmented-assign R6104 Light.setup_as_projector
Use '/=' to do an augmented assign directly
216 0 convention trailing-whitespace C0303
Trailing whitespace

Module blenderproc.python.writer.BopWriterUtility (blenderproc/python/writer/BopWriterUtility.py)

Line Col. Type Symbol ID Obj Message
15 0 convention wrong-import-order C0411
standard import "import sys" should be placed before "import numpy as np"

Metrics

Count per types

Name Count
convention 3
refactor 1

Count per messages

Name Count
line-too-long 1
trailing-whitespace 1
consider-using-augmented-assign 1
wrong-import-order 1

Count per modules

Name Count
blenderproc.python.loader.CCMaterialLoader 1
blenderproc.python.types.LightUtility 2
blenderproc.python.writer.BopWriterUtility 1

Count per path

Name Count
blenderproc/python/loader/CCMaterialLoader.py 1
blenderproc/python/types/LightUtility.py 2
blenderproc/python/writer/BopWriterUtility.py 1
***The tests are done.*** Check the log:

Last update: 10/24/2023, 17:33:28

Copy link
Member

@cornerfarmer cornerfarmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cornerfarmer cornerfarmer merged commit b6bc84b into DLR-RM:main Oct 24, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants