1. Get Photo Upload Url

1 Function description

Get a link to upload the user pose image,cloth image,mask image.

Note that each call will consume 0.1 coins.

2 Request method

method:POST URL :{ApiUrl}/api/inf/fastinf_upload

3 Request parameter

nametypedescribesample

openId

string

your openId

apiKey

string

our apiKey

ipId

string

empty string

poseFileName

string

user pose image

pose.jpg

clothFileName

string

cloth image

cloth.jpg

maskFileName

string

mask image

mask.jpg

infId = -1
clothUrl = ''
maskUrl = ''
poseUrl = ''
params = {'openId':OpenId, 'apiKey':ApiKey, 
    'ipId':'', 'poseFileName':poseName, 'maskFileName':maskName, 
    'clothFileName':clothName}
session = requests.session()
ret = requests.post(f"{ApiUrl}/api/inf/fastinf_upload", data=json.dumps(params))

res = 0
if ret.status_code==200:
    if 'data' in ret.json():
        print(ret.json())
        data = ret.json()['data']
        infId = data['infId']
        clothUrl = data['clothUrl']
        maskUrl = data['maskUrl']
        poseUrl = data['poseUrl']
        """
            {
                "code": 200,
                "msg": "ok",
                "data": {
                    "clothUrl": "",
                    "cod": 1,
                    "infId": 6622,
                    "maskUrl": "",
                    "poseUrl": "h"
                }
            }
        """
        print("currnet infId: ", data['infId'], " Please remember this ID! Otherwise, the task cannot be queried")
    else:
        """
        {
            "code": 500,
            "msg": "Hacker access detected!"
        }
        """
        print(ret.json())
        data = ret.json()
        print("fail info is, ", data)
        exit(0)

Last updated