ZhUyU1997 / open-pose-editor

online 3d openpose editor for stable diffusion and controlnet
https://zhuyu1997.github.io/open-pose-editor/
MIT License
761 stars 188 forks source link

Additional composition output/export type: JSON #61

Open Balthamos opened 1 year ago

Balthamos commented 1 year ago

Hi! Loving your project, it's fantastic to see it constantly evolving!

I saw you mention elsewhere that you're not able to convert 2D JSON pose data to 3D, but what I'm wondering is if it would be possible to do the opposite:

When a pose is created and the camera has been positioned and the user clicks Generate, in addition to the skeletal .png/depth/normal/canny outputs, would it be possible to generate a 2D OpenPose JSON dictionary that represents the scene's current snapshot?

Similar to this:

{
  "people": [{
    "pose_keypoints_2d":
    [321,150,1,359,232,1,293,224,1,250,300,
    1,263,365,1,425,239,1,449,354,1,427,459,
    1,294,427,1,289,505,1,-1,-1,0,372,451,1,374,
    511,1,-1,-1,0,322,134,1,338,137,1,-1,-1,0,379,
    143,1]
    },{
    "pose_keypoints_2d":
    [173,157,1,137,231,1,72,230,1,46,319,1,118,337,
    1,202,231,1,216,322,1,199,346,1,123,414,1,99,
    501,1,-1,-1,0,190,410,1,195,507,1,-1,-1,0,159,142,
    1,177,145,1,125,149,1,-1,-1,0]
     }],
  "width": 512,
  "height": 512
}

It would be very useful as some tools can't import skeleton .pngs, but can import JSON.

Thanks!

ZhUyU1997 commented 1 year ago

interesting! I try to support it. Can you tell me which tool to import?

Balthamos commented 1 year ago

The tool that I use poses with is the Draw Things app for Mac/iOS, it's a fantastic fully featured Stable Diffusion generator that runs completely offline.

It can import 2D poses in OpenPose JSON format, and the poses can then be adjusted inside the app, but poses that are only .pngs are a lot more limited as they can't be edited. The JSON format that would need to be exportable by your editor is just standard OpenPose 2D output