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
{{ message }}
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.
# Copyright (c) Facebook, Inc. and its affiliates.# This source code is licensed under the MIT license found in the# LICENSE file in the root directory of this source tree.importosimportnumpyasnp# noqa: E402importtacto# noqa: E402frommatplotlibimportpyplotasplt# os.environ["PYOPENGL_PLATFORM"] = "osmesa"# os.environ["PYOPENGL_PLATFORM"] = "EDL"os.chdir(os.path.dirname(__file__))
# Render from OSMesa should be deterministicdeftest_render_from_depth_osmesa():
# tacto.Renderer use np.random.randn to generate noise.# Fix the random seed here to make test deterministicnp.random.seed(2020)
# Create rendererrenderer=tacto.Renderer(
width=60, height=80, config_path=tacto.get_digit_config_path(), background=None
)
# Get the path of current filecur_path=os.path.dirname(__file__)
# Renderdepthmap=np.load(os.path.join(cur_path, "depthmap.npy"))
color_gt=np.load(os.path.join(cur_path, "color-osmesa-ground-truth.npy"))
color, _=renderer.render_from_depth(depthmap, scale=0.01)
plt.figure()
plt.subplot(1,3,1)
plt.title("Depth map")
plt.imshow(depthmap)
# plt.colorbar()plt.subplot(1,3,2)
plt.title("color gt")
plt.imshow(color_gt)
plt.subplot(1,3,3)
plt.title("color sim")
plt.imshow(color)
# NOTE(poweic): This is how ground-truth is generated. Run this in docker# and make sure you eyeball the resulting image before committing the change# np.save(os.path.join(cur_path, "color-osmesa-ground-truth.npy"), color)diff=color-color_gtrms= (diff**2).mean() **0.5print("RMSE:{}".format(rms))
plt.show()
if__name__=="__main__":
test_render_from_depth_osmesa()
However, the color image doesn't show a contact, which is not consistent with the depth map.
Is it normal?
I really appreciate your reply.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I added matplotlib support to ./tests/test_render_from_depth_osmesa.py to show the generated color images. The modified codes are shown below.
However, the color image doesn't show a contact, which is not consistent with the depth map.
Is it normal?
I really appreciate your reply.
The text was updated successfully, but these errors were encountered: