DEV Community

AnyISalIn
AnyISalIn

Posted on

5 lines of Python code to change the posture of photography

Mix Pose API novita.ai

You can install the Novita Python SDK using just one command

pip install novita-client
Enter fullscreen mode Exit fullscreen mode

then you can get NOVITA_API_KEY from https://novita.ai/get-started/

Finally, you can try the mix pose demo by following this code.

import os

from novita_client import NovitaClient
from novita_client.utils import base64_to_image

client = NovitaClient(os.getenv('NOVITA_API_KEY'))
res = client.mixpose(
    image="https://image.uniqlo.com/UQ/ST3/my/imagesgoods/455359/item/mygoods_23_455359.jpg?width=494",
    pose_image="https://image.uniqlo.com/UQ/ST3/ca/imagesgoods/455359/item/cagoods_02_455359.jpg?width=494",
)

base64_to_image(res.image_file).save("./mixpose.png")

Enter fullscreen mode Exit fullscreen mode

novita-client is the Python SDK of Novita.AI, which provides the following features.

Top comments (2)

Collapse
 
pavelee profile image
Paweł Ciosek

Cool! 😎

Collapse
 
anyisalin profile image
AnyISalIn

thanks