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

How to control vedo windows shape? #133

Open
lucasjinreal opened this issue Dec 29, 2021 · 29 comments
Open

How to control vedo windows shape? #133

lucasjinreal opened this issue Dec 29, 2021 · 29 comments

Comments

@lucasjinreal
Copy link

image

Hi, default is 1960x1960, I make scaled to 1 rather than 2.
I want it to be rectangle window, how to controll it?

@Arthur151
Copy link
Owner

Arthur151 commented Dec 29, 2021

Here is the instruction to change this line.
Just change to plt = Plotter(size=(h,w),bg=[240,255,255], axes=0, offscreen=not interactive_show) I guess

@lucasjinreal
Copy link
Author

@Arthur151 I make it to rectangle, it becomes like this:

image

plt = Plotter(bg=[240, 255, 255], size=(600, 800), axes=0,
                      offscreen=not interactive_show)

@Arthur151
Copy link
Owner

Arthur151 commented Dec 30, 2021

I am back. Hi, @jinfagang
I have tested that the right way to achieve this is to change this line from image_result = plt.show(camera=self.default_camera) to image_result = plt.show(camera=self.default_camera, size=(800,600))
image

@lucasjinreal
Copy link
Author

@Arthur151 Hi, I changed that line, but I can not got expected result?

image

Also Plotter size params order is H, W, you set to (800, 600), how do u get a rectanlge like above? your height should bigger than width.

@Arthur151
Copy link
Owner

Arthur151 commented Dec 30, 2021

Hi, @jinfagang Bro~
Please set the Plotter back to plt = Plotter(bg=[240,255,255], axes=0, offscreen=not interactive_show), change the line I metioned above only.

I am back. Hi, @jinfagang I have tested that the right way to achieve this is to change this line from image_result = plt.show(camera=self.default_camera) to image_result = plt.show(camera=self.default_camera, size=(800,600)) image

@lucasjinreal
Copy link
Author

@Arthur151 I was set it back and only set size in plt.show..

I found the problem.

the vedo actually can get rectangle vis when set like yours. But what I vis is the result image get back from plt. It just messed up like I posted. Do you know how to get the normal rectangle from plt back?

@lucasjinreal
Copy link
Author

@Arthur151 Oh, I get it. It was a mistake in reshape plt returned image back to cv2 image. the cols and rows are oppsited, you are using rectangle so you didn't get into this error. I fixed it.

@lucasjinreal
Copy link
Author

@Arthur151 btw, do you know how to adjust the camera:

self.default_camera = {'pos': {'far': (0, 800, 1000), 'close': (0, 200, 800)}[
            args().soi_camera]}

I want the bottom plane image more flat, just like I view human on the right front view, do you know which params should adjust?

@Arthur151
Copy link
Owner

Arthur151 commented Dec 30, 2021

You can change the 'far': (0, 800, 1000) to other coords. Assuming that people locate at the origin (0,0,0), you can change the camera location from (0, 800, 1000) (horizental, vertical, far) to other values. Just try~
If possible, please leave the camera location that you perfer in convenience of other developers~

@lucasjinreal
Copy link
Author

@Arthur151 Sure.

image

self.default_camera = {'pos': {'far': (-200, 600, 800), 'close': (0, 200, 800)}[
            args().soi_camera]}

image

self.default_camera = {'pos': {'far': (-200, 200, 800), 'close': (0, 200, 800)}[
            args().soi_camera]}

@lucasjinreal
Copy link
Author

@Arthur151 I have serveral questoin about the ROMP method, could you help me figure it out?

  1. In paper, it says using 22 joints instead original 24 in SMPL, drops 2 hand joints, for what consideration do that?
  2. the SMPL map outputs a shape of 142xHxW, 22x6=132, where is the rest 10 dimension represents?
  3. (might not related to romp): the SMLP wrapper model, it seems doesn't have any params, why it using nn.Module? Is the able change to a single method? It looks like simply some vertices index operation which can be done using torch.index_select or something?

@Arthur151
Copy link
Owner

Of course! Good question!
Q1. The dropped paramereters of 2 hand joints describe the 3D hand posture, which is not estimated by ROMP. So we drop them.
Q2. The rest 10 dimension represents the 3D body shape of SMPL statistical model.
Q3. SMPL model contains some fixed statistical parameters describing the pose prior space, the shape piror space, the joint regressor, and e.t.c. It is defined as nn.Module, because it is used as a layer during model training. Gradients flow though this layer.

@lucasjinreal
Copy link
Author

@Arthur151 so does the registered tensor buffer actually will update params?

btw, I am not very famillar with smpl acutally, newbie here. I wanna ask, if I want do mesh estimation via TopDown approach, rather then E2E, I have get 2d keypoints, then how should I use them get mesh? (Can u give me dedicated flows and method in them?)

@Arthur151
Copy link
Owner

No, it won't update params.

I recommand to read our survey paper.

@lucasjinreal
Copy link
Author

@Arthur151 thank u so much.

I have on last question wanna ask. Do u know how to run that script convert_fbx.py file?

I currently unable install bpy locally, except I directly import from blender python console.

It gives me this error:

image

@Arthur151
Copy link
Owner

Arthur151 commented Dec 30, 2021

Error report is just fine. It still gives you the right fbx file anyway.
Also, feel free to leave you question here. I will reply as soon as possible when I see them.

@Arthur151
Copy link
Owner

Arthur151 commented Jan 1, 2022

@jinfagang Brother Tian~ I get some feedbacks from Vedo developers.
They recommand to refer this example. It seems quite simple.
天哥,新年快乐~ respect~

@lucasjinreal
Copy link
Author

@Arthur151 thank u! this seems a solution.

I got one last final problem to make blender run, would u help me figure out why?

>>> a = bpy.data.objects['Armature.001'].data
>>> a.edit_bones('m_avg_Pelvis')
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
TypeError: 'bpy_prop_collection' object is not callable

>>> bpy.ops.object.mode_set(mode='EDIT')
{'FINISHED'}

>>> pb = a.edit_bones['m_avg_Pelvis']
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
KeyError: 'bpy_prop_collection[key]: key "m_avg_Pelvis" not found'

>>> a.bones.keys()
['m_avg_root', 'm_avg_Pelvis', 'm_avg_L_Hip', 'm_avg_L_Knee', 'm_avg_L_Ankle', 'm_avg_L_Foot', 'm_avg_R_Hip', 'm_avg_R_Knee', 'm_avg_R_Ankle', 'm_avg_R_Foot', 'm_avg_Spine1', 'm_avg_Spine2', 'm_avg_Spine3', 'm_avg_Neck', 'm_avg_Head', 'm_avg_L_Collar', 'm_avg_L_Shoulder', 'm_avg_L_Elbow', 'm_avg_L_Wrist', 'm_avg_L_Hand', 'm_avg_R_Collar', 'm_avg_R_Shoulder', 'm_avg_R_Elbow', 'm_avg_R_Wrist', 'm_avg_R_Hand']

I am really confused by this, it raise error like this:

KeyError: 'bpy_prop_collection[key]: key "m_avg_Pelvis" not found'
错误: Python 脚本失败,请检查系统控制台中的消息

But as you can see above, I printed bpy object data bones keys, it just exist. Do u know how to avoid this error?

@lucasjinreal
Copy link
Author

Oh. I solved it by remove all other Amatures.

I currently can make smpl model move:

image

but, How can I apply these fbx to another new model?

@Arthur151
Copy link
Owner

Arthur151 commented Jan 1, 2022 via email

@lucasjinreal
Copy link
Author

@Arthur151 Bro, don't joke me, you already make some amazing effect drive new charactors realtime in your webcam demo. Do u know how to drive them? For example, some fbx models download from here: https://www.mixamo.com/#/

@Arthur151
Copy link
Owner

Arthur151 commented Jan 2, 2022 via email

@lucasjinreal
Copy link
Author

@Arthur151 so the demo actually doesn't runs in realtime and automatic right?

@Arthur151
Copy link
Owner

Arthur151 commented Jan 2, 2022 via email

@lucasjinreal
Copy link
Author

@Arthur151 But, I still don't know, how do u sync the fbx animation to target charactor, since you have to manually retargeting it right ? How to automatic that process?

@lucasjinreal
Copy link
Author

@Arthur151 Brother, I found for models download from mixamo, the bones names are not same as SMPL. Do u know where to download the same charactor as your demo, which can direclty mapping animations from SMPL fbx to charactores?
image

@lucasjinreal
Copy link
Author

@Arthur151 Hi, Brother. I found when I run webcam.sh, it was stucked:

image

Seems socket can not be established to Blender, does there any recevier need to installed or enabled on blender side?

@Arthur151
Copy link
Owner

Yes, here is the instruction. This repo from my colleague might helps. He knows Blender better.

@lucasjinreal
Copy link
Author

@Arthur151 thanks. Do u have a wechat group or QQ group to talk about ROMP? I really want to communicate about it.

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

No branches or pull requests

2 participants