Skip to main content

ðŸ“ļ āļ•āļąāļ§āļĨāļšāļžāļ·āđ‰āļ™āļŦāļĨāļąāļ‡āļ āļēāļž (Remove Background AI)

ðŸ“ļ AI āļĨāļšāļžāļ·āđ‰āļ™āļŦāļĨāļąāļ‡āļŠāļģāļŦāļĢāļąāļšāļ•āļāđāļ•āđˆāļ‡āļĢāļđāļ›āļ•āļīāļ”āļšāļąāļ•āļĢ (āļ•āļąāļ”āļŦāļąāļ§āđƒāļŠāđˆāđ€āļŠāļ·āđ‰āļ­) Version Status

Image Background Remover āļ„āļ·āļ­āļšāļĢāļīāļāļēāļĢ AI āļŠāļģāļŦāļĢāļąāļšāļāļēāļĢāļĨāļšāļžāļ·āđ‰āļ™āļŦāļĨāļąāļ‡āļˆāļēāļāļĢāļđāļ›āļ āļēāļžāļ—āļļāļāļ›āļĢāļ°āđ€āļ āļ— āļĢāļđāļ›āđ€āļ‹āļĨāļŸāļĩāđˆ āđ‚āļ”āļĒāđ€āļ‰āļžāļēāļ°āļ­āļĒāđˆāļēāļ‡āļĒāļīāđˆāļ‡āļĄāļĩāļ›āļĢāļ°āđ‚āļĒāļŠāļ™āđŒāļŠāļģāļŦāļĢāļąāļšāļĢāļđāļ›āļ–āđˆāļēāļĒāļšāļąāļ•āļĢāļ›āļĢāļ°āļˆāļģāļ•āļąāļ§āđāļĨāļ°āļāļēāļĢāđ€āļ›āļĨāļĩāđˆāļĒāļ™āļ āļēāļžāļ–āđˆāļēāļĒāļŦāļąāļ§

āđ€āļĢāļīāđˆāļĄāļ•āđ‰āļ™āđƒāļŠāđ‰āļ‡āļēāļ™â€‹

  1. āļ‚āđ‰āļ­āļāļģāļŦāļ™āļ”āđ€āļšāļ·āđ‰āļ­āļ‡āļ•āđ‰āļ™

    • API key āļˆāļēāļ āļšāļĢāļīāļĐāļąāļ— āđ„āļ­āđāļ­āļžāļžāđŒāđ€āļ—āļ„āđ‚āļ™āđ‚āļĨāļĒāļĩ āļˆāļģāļāļąāļ”
    • āļĢāļđāļ›āļ āļēāļžāļ—āļļāļāļ›āļĢāļ°āđ€āļ āļ— āļĢāļđāļ›āđ€āļ‹āļĨāļŸāļĩāđˆ āđ‚āļ”āļĒāđ€āļ‰āļžāļēāļ°āļ­āļĒāđˆāļēāļ‡āļĒāļīāđˆāļ‡āļĄāļĩāļ›āļĢāļ°āđ‚āļĒāļŠāļ™āđŒāļŠāļģāļŦāļĢāļąāļšāļĢāļđāļ›āļ–āđˆāļēāļĒāļšāļąāļ•āļĢāļ›āļĢāļ°āļˆāļģāļ•āļąāļ§
    • āļĢāļđāļ›āđāļšāļšāđ„āļŸāļĨāđŒāļ—āļĩāđˆāļĢāļ­āļ‡āļĢāļąāļš: JPEG, JPG, PNG
    • āļ‚āļ™āļēāļ”āđ„āļŸāļĨāđŒāļŠāļđāļ‡āļŠāļļāļ”: 2MB
  2. āđ€āļĢāļīāđˆāļĄāļ•āđ‰āļ™āļ­āļĒāđˆāļēāļ‡āļĢāļ§āļ”āđ€āļĢāđ‡āļ§

    • āļāļēāļĢāļ›āļĢāļ°āļĄāļ§āļĨāļœāļĨāļ—āļĩāđˆāļĢāļ§āļ”āđ€āļĢāđ‡āļ§
    • āļ„āļ§āļēāļĄāđāļĄāđˆāļ™āļĒāļģāļŠāļđāļ‡
  3. āļ„āļļāļ“āļŠāļĄāļšāļąāļ•āļīāļŦāļĨāļąāļ

    • āļĨāļšāļžāļ·āđ‰āļ™āļŦāļĨāļąāļ‡āļˆāļēāļāļĢāļđāļ›āđ€āļ‹āļĨāļŸāļĩāđˆ
    • āļĄāļĩāļ›āļĢāļ°āđ‚āļĒāļŠāļ™āđŒāļŠāļģāļŦāļĢāļąāļšāļĢāļđāļ›āļ–āđˆāļēāļĒāļšāļąāļ•āļĢāļ›āļĢāļ°āļˆāļģāļ•āļąāļ§āđāļĨāļ°āļāļēāļĢāđ€āļ›āļĨāļĩāđˆāļĒāļ™āļ āļēāļžāļ–āđˆāļēāļĒāļŦāļąāļ§
    • āļŦāļĄāļļāļ™āđ€āļ›āđ‡āļ™āđāļ™āļ§āļ™āļ­āļ™
    • āļĄāļĩāļ›āļĢāļ°āđ‚āļĒāļŠāļ™āđŒāļŠāļģāļŦāļĢāļąāļšāļāļēāļĢāđƒāļŠāđ‰āļ‡āļēāļ™āđāļ­āļ›āļžāļĨāļīāđ€āļ„āļŠāļąāļ™āļšāļ™āļĄāļ·āļ­āļ–āļ·āļ­āļ—āļĩāđˆāļ‡āđˆāļēāļĒāļ‚āļķāđ‰āļ™
  4. āļ„āļ§āļēāļĄāļ›āļĨāļ­āļ”āļ āļąāļĒāđāļĨāļ°āļāļēāļĢāļ›āļāļīāļšāļąāļ•āļīāļ•āļēāļĄāļāļŽāļĢāļ°āđ€āļšāļĩāļĒāļš

    • āļ›āļāļīāļšāļąāļ•āļīāļ•āļēāļĄ GDPR āđāļĨāļ° PDPA
    • āđ„āļĄāđˆāļĄāļĩāļāļēāļĢāđ€āļāđ‡āļšāļĢāļąāļāļĐāļēāļ‚āđ‰āļ­āļĄāļđāļĨāļŦāļĨāļąāļ‡āļˆāļēāļāļāļēāļĢāļ›āļĢāļ°āļĄāļ§āļĨāļœāļĨ
āļ§āļīāļ˜āļĩāļāļēāļĢāļĢāļąāļš API Key?

āļāļĢāļļāļ“āļēāđ€āļĒāļĩāđˆāļĒāļĄāļŠāļĄ iApp AI Portal āđ€āļžāļ·āđˆāļ­āļ”āļđ API key āļ—āļĩāđˆāļĄāļĩāļ­āļĒāļđāđˆāļ‚āļ­āļ‡āļ„āļļāļ“āļŦāļĢāļ·āļ­āļ‚āļ­ API key āđƒāļŦāļĄāđˆ

āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡â€‹

āļ„āļģāļ‚āļ­â€‹

curl --location 'https://api.iapp.co.th/face-extractor/predict/file' \
--header 'apikey: {YOUR API KEY}' \
--form 'file=@"/Users/iapp/Downloads/2 (3).png"' \
--form 'rotateIfPortiat="True"'

āļ‚āđ‰āļ­āļĄāļđāļĨāļ­āđ‰āļēāļ‡āļ­āļīāļ‡ API​

āļˆāļļāļ”āļŠāļīāđ‰āļ™āļŠāļļāļ”​

POST https://api.iapp.co.th/face-extractor/predict/file

āļŠāđˆāļ§āļ™āļŦāļąāļ§â€‹

āļŠāļ·āđˆāļ­āļŠāļ™āļīāļ”āļ„āļģāļ­āļ˜āļīāļšāļēāļĒ
apikeyStringAPI Key āļ‚āļ­āļ‡ iApp AI

āđ€āļ™āļ·āđ‰āļ­āļŦāļēāļ„āļģāļ‚āļ­â€‹

āļŠāļ·āđˆāļ­āļŠāļ™āļīāļ”āļ„āļģāļ­āļ˜āļīāļšāļēāļĒ
rotateIfPortiatBooleanāļ–āđ‰āļēāļžāļēāļĢāļēāļĄāļīāđ€āļ•āļ­āļĢāđŒāļ™āļĩāđ‰āļ–āļđāļāļ•āļąāđ‰āļ‡āļ„āđˆāļēāđ€āļ›āđ‡āļ™ "true" āđāļĨāļ°āļĢāļđāļ›āļ āļēāļžāđ€āļ›āđ‡āļ™āđāļ™āļ§āļ•āļąāđ‰āļ‡ āļœāļĨāļĨāļąāļžāļ˜āđŒāļˆāļ°āļ–āļđāļāļŦāļĄāļļāļ™āđ€āļ›āđ‡āļ™āđāļ™āļ§āļ™āļ­āļ™ āļĄāļĩāļ›āļĢāļ°āđ‚āļĒāļŠāļ™āđŒāļŠāļģāļŦāļĢāļąāļšāļāļēāļĢāđƒāļŠāđ‰āļ‡āļēāļ™āđāļ­āļ›āļžāļĨāļīāđ€āļ„āļŠāļąāļ™āļšāļ™āļĄāļ·āļ­āļ–āļ·āļ­āļ—āļĩāđˆāļ‡āđˆāļēāļĒāļ‚āļķāđ‰āļ™
filefileāđ„āļŸāļĨāđŒāļĢāļđāļ›āļ āļēāļž .PNG āļŦāļĢāļ·āļ­ .JPEG āļŦāļĢāļ·āļ­ .JPG

āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āđ‚āļ„āđ‰āļ”​

Python​

import requests

url = "https://api.iapp.co.th/face-extractor/predict/file"

payload = {}
files=[
('file',('{YOUR UPLOADED FILE NAME}',open('{YOUR UPLOADED FILE PATH}','rb'),'image/png'))
]
headers = {
'apikey': '{YOUR_API_KEY}'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

JavaScript​

const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('file', fs.createReadStream('{YOUR UPLOADED FILE PATH}'));

let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.iapp.co.th/face-extractor/predict/file',
headers: {
'apikey': '{YOUR_API_KEY}',
...data.getHeaders()
},
data : data
};

axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});

PHP​

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.iapp.co.th/face-extractor/predict/file',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('{YOUR UPLOADED FILE PATH}')),
CURLOPT_HTTPHEADER => array(
'apikey: {YOUR_API_KEY}'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Swift​

let parameters = [
[
"key": "file",
"src": "{YOUR UPLOADED FILE PATH}",
"type": "file"
]] as [[String: Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = Data()
var error: Error? = nil
for param in parameters {
if param["disabled"] != nil { continue }
let paramName = param["key"]!
body += Data("--\(boundary)\r\n".utf8)
body += Data("Content-Disposition:form-data; name=\"\(paramName)\"".utf8)
if param["contentType"] != nil {
body += Data("\r\nContent-Type: \(param["contentType"] as! String)".utf8)
}
let paramType = param["type"] as! String
if paramType == "text" {
let paramValue = param["value"] as! String
body += Data("\r\n\r\n\(paramValue)\r\n".utf8)
} else {
let paramSrc = param["src"] as! String
let fileURL = URL(fileURLWithPath: paramSrc)
if let fileContent = try? Data(contentsOf: fileURL) {
body += Data("; filename=\"\(paramSrc)\"\r\n".utf8)
body += Data("Content-Type: \"content-type header\"\r\n".utf8)
body += Data("\r\n".utf8)
body += fileContent
body += Data("\r\n".utf8)
}
}
}
body += Data("--\(boundary)--\r\n".utf8);
let postData = body


var request = URLRequest(url: URL(string: "https://api.iapp.co.th/face-extractor/predict/file")!,timeoutInterval: Double.infinity)
request.addValue("{YOUR_API_KEY}", forHTTPHeaderField: "apikey")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}

task.resume()

Kotlin​

val client = OkHttpClient()
val mediaType = "text/plain".toMediaType()
val body = MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","{YOUR UPLOADED FILE NAME}",
File("{YOUR UPLOADED FILE PATH}").asRequestBody("application/octet-stream".toMediaType()))
.build()
val request = Request.Builder()
.url("https://api.iapp.co.th/face-extractor/predict/file")
.post(body)
.addHeader("apikey", "{YOUR_API_KEY}")
.build()
val response = client.newCall(request).execute()

Java​

OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","{YOUR UPLOADED FILE NAME}",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("{YOUR UPLOADED FILE PATH}")))
.build();
Request request = new Request.Builder()
.url("https://api.iapp.co.th/face-extractor/predict/file")
.method("POST", body)
.addHeader("apikey", "{YOUR_API_KEY}")
.build();
Response response = client.newCall(request).execute();

Dart​

var headers = {
'apikey': '{YOUR_API_KEY}'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.iapp.co.th/face-extractor/predict/file'));
request.files.add(await http.MultipartFile.fromPath('file', '{YOUR UPLOADED FILE PATH}'));
request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}