You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am trying to run a simple script that is like a hybrid of examples/basic/physics_positioning and examples/advanced/point_clouds. After running it a number of times, bproc.object.simulate_physics_and_fix_final_poses() takes longer and longer to run, and when finished I get the print out: Blender quit Error: Not freed memory blocks: 9, total unfreed memory 49.438984 MB Cleaning temporary directory
What can be done to delete or free these memory blocks? I have tried to find the solution but I am yet to succeed. And also, is there a common cause for the accumulation of these?
Thank you!
Minimal code example
bproc.init()
# load blender materials from cubesblendermetallic=bproc.loader.load_blend("U:/Data\Objekt\Blender/metallic_cube.blend", data_blocks='materials')
# Load the chosen object into the sceneactive= []
foriinrange(args.num_objects):
active.append(bproc.loader.load_obj("u:\Data\object.obj")[0])
# load a surfacescene= [bproc.loader.load_obj("U:\Data\plane.obj")[0]]
scene_pos=np.array([0, 0, -1500]) # pose in mmscene[0].set_location(scene_pos)
# load a bin for objects to fall in toscene.append(bproc.loader.load_obj("U:\Data/bin.obj")[0])
scene[1].set_location(scene_pos+ [0, 0, 110]) # pose in mm# Make all objects actively participate in the simulationforobjinactive:
obj.enable_rigidbody(active=True)
obj.add_material(metallic[1])
obj.set_cp("category_id", 1)
# The scene should only act as an obstacle and is therefore marked passive.# To let the objects fall into the valleys of the ground, make the collision shape MESH instead of CONVEX_HULL.forobjinscene:
obj.enable_rigidbody(active=False, collision_shape="MESH")
# Define a function that samples the pose of a given spheredefsample_pose(obj: bproc.types.MeshObject):
obj.set_location(np.random.uniform(scene_pos+ [-150, -150, 300], scene_pos+ [150, 150, 500]))
print(obj.get_location())
obj.set_rotation_euler(bproc.sampler.uniformSO3())
# Sample the poses of all objects above the ground without any collisions in-betweenbproc.object.sample_poses(
active,
sample_pose_func=sample_pose
)
# Run the simulation and fix the poses of the objects at the endbproc.object.simulate_physics_and_fix_final_poses(min_simulation_time=4, max_simulation_time=60, check_object_interval=1)
bvh_tree=bproc.object.create_bvh_tree_multi_objects(active+scene)
# define the camera resolution for the pcbproc.camera.set_resolution(1024, 1024)
bproc.camera.set_intrinsics_from_blender_params(clip_start=1200.0, clip_end=1600.0)
position, euler_rotation= [0, 0, 0], [0, 0, 0]
matrix_world=bproc.math.build_transformation_mat(position, euler_rotation)
bproc.camera.add_camera_pose(matrix_world)
# Compute a depth image from the view of the second camera posedepth=bproc.camera.depth_via_raytracing(bvh_tree, 1)
# Project the depth again to get a point cloudpoints=bproc.camera.pointcloud_from_depth(depth, 1)
points=points.reshape(-1, 3)
bproc.renderer.enable_depth_output(activate_antialiasing=False)
# set camera res for renderingbproc.camera.set_resolution(512, 512)
# render the whole pipelinedata=bproc.renderer.render()
# Write BOP-databproc.writer.write_bop(output_dir="./output/",
target_objects=active,
depths=data["depth"],
colors=data["colors"],
color_file_format="PNG",
append_to_existing_output=True,
save_world2cam=True,
ignore_dist_thres=3000.0,
annotation_unit='m'
)
Files required to run the code
No response
Expected behavior
I expect the simulation to finish within 20 seconds as it did before. Now i get the following prints:
BlenderProc version
2.8.0
The text was updated successfully, but these errors were encountered:
Describe the issue
Hello,
I am trying to run a simple script that is like a hybrid of examples/basic/physics_positioning and examples/advanced/point_clouds. After running it a number of times,
bproc.object.simulate_physics_and_fix_final_poses()
takes longer and longer to run, and when finished I get the print out:Blender quit
Error: Not freed memory blocks: 9, total unfreed memory 49.438984 MB
Cleaning temporary directory
What can be done to delete or free these memory blocks? I have tried to find the solution but I am yet to succeed. And also, is there a common cause for the accumulation of these?
Thank you!
Minimal code example
Files required to run the code
No response
Expected behavior
I expect the simulation to finish within 20 seconds as it did before. Now i get the following prints:
BlenderProc version
2.8.0
The text was updated successfully, but these errors were encountered: