ROMP icon indicating copy to clipboard operation
ROMP copied to clipboard

How to control vedo windows shape?

Open lucasjinreal opened this issue 3 years ago • 29 comments

image

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

lucasjinreal avatar Dec 29 '21 14:12 lucasjinreal

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

Arthur151 avatar Dec 29 '21 14:12 Arthur151

@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)

lucasjinreal avatar Dec 29 '21 15:12 lucasjinreal

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

Arthur151 avatar Dec 30 '21 01:12 Arthur151

@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.

lucasjinreal avatar Dec 30 '21 02:12 lucasjinreal

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

Arthur151 avatar Dec 30 '21 02:12 Arthur151

@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 avatar Dec 30 '21 03:12 lucasjinreal

@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 avatar Dec 30 '21 03:12 lucasjinreal

@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?

lucasjinreal avatar Dec 30 '21 03:12 lucasjinreal

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~

Arthur151 avatar Dec 30 '21 03:12 Arthur151

@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 avatar Dec 30 '21 06:12 lucasjinreal

@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?

lucasjinreal avatar Dec 30 '21 06:12 lucasjinreal

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.

Arthur151 avatar Dec 30 '21 09:12 Arthur151

@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?)

lucasjinreal avatar Dec 30 '21 11:12 lucasjinreal

No, it won't update params.

I recommand to read our survey paper.

Arthur151 avatar Dec 30 '21 11:12 Arthur151

@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

lucasjinreal avatar Dec 30 '21 14:12 lucasjinreal

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 avatar Dec 30 '21 14:12 Arthur151

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

Arthur151 avatar Jan 01 '22 03:01 Arthur151

@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 avatar Jan 01 '22 07:01 lucasjinreal

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?

lucasjinreal avatar Jan 01 '22 07:01 lucasjinreal

Now we are on the stage. We are facing the same problem. Get Outlook for Android

Arthur151 avatar Jan 01 '22 08:01 Arthur151

@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/#/

lucasjinreal avatar Jan 01 '22 16:01 lucasjinreal

I am not joking. We are working on this stage too. The demo of driving another character is not implement by technical method. It just bind the skeleton from SMPL to the other character by hand with the help of some engineers. My colleages are developing the automatic retargeting now. I am in charge of developing better ROMP, not retargeting thing. I don't know nuch about retargeting. Sorry for that. Get Outlook for Android

Arthur151 avatar Jan 02 '22 01:01 Arthur151

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

lucasjinreal avatar Jan 02 '22 02:01 lucasjinreal

With a character that have similar skeleton with SMPL, the demo can run in real time. Otherwise, it won't. That part is not the focus of this project. There might be  other rep. that can achieve this. Get Outlook for Android

Arthur151 avatar Jan 02 '22 04:01 Arthur151

@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 avatar Jan 02 '22 14:01 lucasjinreal

@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 avatar Jan 02 '22 14:01 lucasjinreal

@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?

lucasjinreal avatar Jan 02 '22 15:01 lucasjinreal

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

Arthur151 avatar Jan 04 '22 02:01 Arthur151

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

lucasjinreal avatar Jan 04 '22 03:01 lucasjinreal