Skip to content

Experimental: Add initial wavefront/obj parser for vertices #1315

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

Merged
merged 1 commit into from
Mar 5, 2021

Conversation

yongtang
Copy link
Member

@yongtang yongtang commented Feb 26, 2021

This PR is an early experimental implementation of wavefront obj
parser in tensorflow-io for 3D objects.
This PR is the first step to obtain raw vertices in float32
tensor with shape of [n, 3].

Additional follow up PRs will be needed to handle meshs with
different shapes (not sure if ragged tensor will be a good fit
in that case)

Some background on obj file:
Wavefront (obj) is a format widely used in 3D (another is ply)
modeling (http://paulbourke.net/dataformats/obj/). It is simple
(ASCII) with good support for many softwares. Machine learning
in 3D has been an active field with some advances such as
PolyGen (https://arxiv.org/abs/2002.10880)

Processing obj files are needed to process 3D with tensorflow.

In 3D the basic elements could be vertices or faces. This PR
tries to cover vertices first so that vertices in obj file
can be loaded into TF's graph for further processing within
graph pipeline.

Signed-off-by: Yong Tang yong.tang.github@outlook.com

@burgerkingeater
Copy link
Member

do you have any introduction to wavefront format? Can you link it in the PR given it's a less known format.

@yongtang
Copy link
Member Author

@burgerkingeater obj file is a simple ASCII format for 3D models (http://paulbourke.net/dataformats/obj/). I have updated the PR with additional description. Please take a look.

Copy link
Member

@kvignesh1420 kvignesh1420 left a comment

Choose a reason for hiding this comment

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

@yongtang thanks for adding the support for the wavefront .obj file format. Please check the minor docstring change.

This PR is an early experimental implementation of wavefront obj
parser in tensorflow-io for 3D objects.
This PR is the first step to obtain raw vertices in float32
tensor with shape of `[n, 3]`.

Additional follow up PRs will be needed to handle meshs with
different shapes (not sure if ragged tensor will be a good fit
in that case)

Some background on obj file:
Wavefront (obj) is a format widely used in 3D (another is ply)
modeling (http://paulbourke.net/dataformats/obj/). It is simple
(ASCII) with good support for many softwares. Machine learning
in 3D has been an active field with some advances such as
PolyGen (https://arxiv.org/abs/2002.10880)

Processing obj files are needed to process 3D with tensorflow.

In 3D the basic elements could be vertices or faces. This PR
tries to cover vertices first so that vertices in obj file
can be loaded into TF's graph for further processing within
graph pipeline.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@yongtang
Copy link
Member Author

yongtang commented Mar 5, 2021

@kvignesh1420 Thanks for the review. The PR has been updated. Please take a look.

Copy link
Member

@kvignesh1420 kvignesh1420 left a comment

Choose a reason for hiding this comment

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

LGTM.

@kvignesh1420 kvignesh1420 merged commit fe0618d into tensorflow:master Mar 5, 2021
@yongtang yongtang deleted the tinyobjloader branch March 5, 2021 17:18
michaelbanfield pushed a commit to michaelbanfield/io that referenced this pull request Mar 30, 2021
…ow#1315)

This PR is an early experimental implementation of wavefront obj
parser in tensorflow-io for 3D objects.
This PR is the first step to obtain raw vertices in float32
tensor with shape of `[n, 3]`.

Additional follow up PRs will be needed to handle meshs with
different shapes (not sure if ragged tensor will be a good fit
in that case)

Some background on obj file:
Wavefront (obj) is a format widely used in 3D (another is ply)
modeling (http://paulbourke.net/dataformats/obj/). It is simple
(ASCII) with good support for many softwares. Machine learning
in 3D has been an active field with some advances such as
PolyGen (https://arxiv.org/abs/2002.10880)

Processing obj files are needed to process 3D with tensorflow.

In 3D the basic elements could be vertices or faces. This PR
tries to cover vertices first so that vertices in obj file
can be loaded into TF's graph for further processing within
graph pipeline.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
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.

3 participants