Luxand.cloud Face Recognition

付费
通过 Luxand Inc | 已更新 24 दिन पहले | Visual Recognition
人气

5.8 / 10

延迟

2,615ms

服务等级

100%

Health Check

N/A

返回所有讨论

Uploading base64 images

Rapid account: Kareememadftw 1
kareememadftw1
4 वर्ष पहले

Hello, I really like your api but im having trouble sending base64 images taken by the phone’s camera and even if I type in the generated base64 string on rapid api, it throws internal server error, what am i doing wrong? I can only get it to work on urls.

Rapid account: Yukyiwan
yukyiwan Commented 3 वर्ष पहले

//The brilliant CS has given me the answer!!! She/he is the best (I think Dan is just the bot’s name!)

//The answer is the base64string has to just lose the first part: “'data:image/jpeg;base64,” leaving just anything after the comma, so the below use “.split(,)[1]” to achieve it

var options = {
method: ‘POST’,
url: “https://api.luxand.cloud/subject/v2”,
qs: {“name”:email,“store”:“1”},
headers: {
‘token’: “…”
},
formData: {
photo: base64string.split(’,’)[1]
}
};

    request(options, function (error, response, body) {
        if (error) throw new Error(error);

        console.log(body);
        
    });
Rapid account: Samhua 1
samhua1 Commented 4 वर्ष पहले

Hello ,

I am having the same problem. I am using Swift 5. I was able to successfully call “create person”, but I receive the following error when calling “Add face to person”:

Response= {
“status” : “failure”,
“message” : “Subject not found”
}

I have tried sending both a base64 encoded image payload or a URL payload. Both approaches gave me the same error.

Here is a snippet of the request code:

// url =URL(string: “https://api.luxand.cloud/subject/”)
// id = id return from Create Person

      let headers = [
            "token": API_TOKEN,
            "content-type": "application/x-www-form-urlencoded"
        ]
                    
        let imageBase64String = image.jpegData(compressionQuality: 1)?.base64EncodedString() ?? ""
        let dataString = "photo="+imageBase64String
        let postData = NSMutableData(data: dataString.data(using: String.Encoding.utf8)!)
        
        let newURL = url.appendingPathComponent("store="+id)
        
        var request = URLRequest(url: newURL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
        
        request.httpMethod = "POST"
        request.allHTTPHeaderFields = headers
        request.httpBody = postData as Data
        
        AF.request(request).validate().responseJSON(completionHandler: { (response) in
            if let error = response.error {
                print("Error=",error.localizedDescription)
                completion(false)
            }
            else {
                let json : JSON = JSON(response.value!)
                print("Response=",json)
                completion(true)
            }
        })
Rapid account: Srushti D 13
SrushtiD13 Commented 4 वर्ष पहले

I am also facing the same issue. Please look into it.

Rapid account: Aboykov
aboykov Commented 4 वर्ष पहले

Hello, thank you for a question. It seems like base64 code is incorrect. Can you image and base64 you have to info at luxand.cloud? We will check and answer.

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论