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

3D algorithms benchmark script added #13

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

savuor
Copy link

@savuor savuor commented Mar 28, 2024

This PR changes

Adding a script that downloads models from a specific dataset, runs several 3D algorithms on it and calculates accuracy.

TODO:

  • Point cloud generation: subsample triangles in proportion to overall surface area
  • Colored mesh generation for triangleRasterize(): assign vertex color based on a color from a texture
  • Collecting stats
  • More camera poses
  • Correctly process Stanford files (w/o textures)
  • No hardcoded filenames, better argument processing

@savuor savuor marked this pull request as ready for review April 16, 2024 03:25
Comment on lines +21 to +22
if sys.version_info[0] < 3 or sys.version_info[1] < 5:
raise Exception("Python 3.5 or greater is required. Try running `python3 download_collection.py`")
Copy link
Contributor

Choose a reason for hiding this comment

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

normL2Rgb = np.linalg.norm(colorDiff, ord=2) / (width * height)
print("rgb L2: %f Inf: %f" % (normL2Rgb, normInfRgb))

cv.imwrite(color_diff_path, (colorDiff.reshape((height, width, 3)) + 1) * 0.5 * 255.0)
Copy link
Contributor

Choose a reason for hiding this comment

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

why *0.5?

Copy link
Author

Choose a reason for hiding this comment

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

because difference range is 2x bigger than value range

colorGl = colorGl.astype(np.float32) * (1.0/255.0)
colorDiff = np.ravel(colorGl - colorRasterize)
normInfRgb = np.linalg.norm(colorDiff, ord=np.inf)
normL2Rgb = np.linalg.norm(colorDiff, ord=2) / (width * height)
Copy link
Contributor

Choose a reason for hiding this comment

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

I propose to report min/max/average, but not only value normalized on pixel count. In case if the scene is sparse and most of pixels are background the current value is not informative.

position = np.array([0.0, 0.0, zat], dtype=np.float32)
lookat = np.array([0.0, 0.0, 0.0], dtype=np.float32)
upVector = np.array([0.0, 1.0, 0.0], dtype=np.float32)
cameraPose = lookAtMatrixCal(position, lookat, upVector)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we need to add it to OpenCV as API.

Comment on lines +1 to +2
# Script to download Scanned Objects by Google Research dataset and Stanford models
# Distributed by CC-BY 4.0 License
Copy link
Contributor

Choose a reason for hiding this comment

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

Please extract Google owned code as dedicated file with own license header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants