henry123-boy / SpaTracker

[CVPR 2024 Highlight] Official PyTorch implementation of SpatialTracker: Tracking Any 2D Pixels in 3D Space
Other
693 stars 23 forks source link

Asking about the visualization code #13

Open ngoductuanlhp opened 4 months ago

ngoductuanlhp commented 4 months ago

Hi @henry123-boy

Thank you for your great work!

I'm currently try to visualize the 3D trajectory using your Blender script. Could you clarify which Blender version you are using? I encounter several errors due to the incompatible Blender version.

Thanks.

cherubicXN commented 4 months ago

Blender 4.0 is used for 3D trajectory visualization

AstroTheKat commented 3 months ago

@cherubicXN thank you for this project and the tip!

Is there any chance you could provide some step-by-step instructions for setting up Blender to render the 3D trajectories via create.py? The command given in the README suggests one can use Blender on MacOS to do this, but there are a few details missing. For example, packages like trimesh and matplotlib need to be installed using Blender's versions of Python and pip.

Regarding the version of Blender needed, I'm not sure 4.0 would work with create.py, unless I'm missing something. For example, bpy.ops.import_mesh.ply was removed in Blender 4.0, and probably needs to be replaced with bpy.ops.wm.ply_import. See links below for more on this:

Otherwise, I get the error: AttributeError: Calling operator "bpy.ops.import_mesh.ply" error, could not be found

a-mirecki commented 3 months ago

Hey @AstroTheKat I've been there, you have a different version thus should replace line 58:

bpy.ops.wm.ply_import(filepath=str(ply_path))
basename = basename.split('\\')[-1]

with

bpy.ops.import_mesh.ply(filepath=str(ply_path),use_verts=True)

then you need to open blender, go to scripting, open console and for each module do

import pip
pip.main([“install”, “trimesh”])

for each module. Lmk whether that was it

Boey-li commented 1 month ago

@cherubicXN @a-mirecki Hello, thanks for your help! I have implemented as you suggested and I still have a bug

  File "/Users/baoyu/research/visualizer/create.py", line 62, in <module>
    obj = bpy.data.objects[basename]
KeyError: 'bpy_prop_collection[key]: key "assets/sintel_bandage_3d_2" not found'

Have you met this issue before? And the blender did not have tracking animation shown in the repo:

https://github.com/user-attachments/assets/43a0acea-7f26-43ae-ba8d-5c5158f8ec3f

boytjj commented 3 weeks ago

https://github.com/TombstoneTumbleweedArt/import-ply-as-verts check this