본문 바로가기
개발/JAVA

Image Auto-Tagging API

by ㅣ푸른하늘ㅣ 2018. 7. 24.
반응형

Auto-Tagging API

Automatically assign tags to your images.
Powerful API that makes your images findable.

이미지를 분석해서 해당 이미지의 tag를 자동적으로 생성해주는 API


https://imagga.com



무료는 아니고 유료이며 


java code


/* Please note that this example uses the HttpURLConnection class */ String credentialsToEncode = "<replace-with-your-api-key>" + ":" + "<replace-with-your-api-secret>"; String basicAuth = Base64.getEncoder().encodeToString(credentialsToEncode.getBytes(StandardCharsets.UTF_8)); String endpoint_url = "https://api.imagga.com/v1/tagging"; String image_url = "https://imagga.com/static/images/tagging/wind-farm-538576_640.jpg"; String url = endpoint_url + "?url=" + image_url; URL urlObject = new URL(url); HttpURLConnection connection = (HttpURLConnection) urlObject.openConnection(); connection.setRequestProperty("Authorization", "Basic " + basicAuth); int responseCode = connection.getResponseCode(); System.out.println("\nSending 'GET' request to URL : " + url); System.out.println("Response Code : " + responseCode); BufferedReader connectionInput = new BufferedReader(new InputStreamReader(connection.getInputStream())); String jsonResponse = connectionInput.readLine(); connectionInput.close(); System.out.println(jsonResponse);


https://imagga.com/auto-tagging-demo

반응형