google-research / nerf-from-image

Shape, Pose, and Appearance from a Single Image via Bootstrapped Radiance Field Inversion
Apache License 2.0
377 stars 18 forks source link

How to accurately control the generation of vehicle images based on the input angle range? #7

Closed Fengzexu closed 1 year ago

Fengzexu commented 1 year ago

Awesome work! I want to specify the angle of generating vehicles and precisely generate the corresponding pictures.For example, how to modify the configuration to generate a vehicle on the side?

dariopavllo commented 1 year ago

Hi,

The rendering function takes a camera matrix as input (in the form of a camera-to-world transformation). You can call pose_utils.matrix_to_pose on such a matrix to recover its components (e.g. translation, rotation, focal length in world-to-camera format). Then, you can manipulate the rotation (a quaternion) directly. Finally, you can call pose_utils.pose_to_matrix to obtain the new camera matrix that you need to pass to the renderer.

Fengzexu commented 1 year ago

Thank you for taking the time to answer me. I now want to inferrnce my custom image data with custom camera pose. I want to render the vehicle at the bbox position while maintaining the current image of the vehicle's posture and the relative position of the camera. Do I need to modify the direction of the rays? Do you have any suggestions? Thank you in advance