⛏️imageSimilarityTest

Description

Search in to our image similarity database for similar images.

Parameters

ParameterTypeDescription

imageUrl

string

test image URL

Response

ParameterTypeDescription

message

string

message about the response

status

int

0 for no image found

1 for images found

-1 for any error occurs during the execution of the request

metadata

list

list of object of the metadata associated with the found images

img

object

this object will contain four properties, they can be None keyPoint1 and keyPoint2 will be the points matched between two images, the test image and the found image matchedImg will be the comparative image of the two images in base64 format score will be the similarity score of the search

Example Request and Response

Prerequisites

Before making requests with NEST® SDK, you must have it installed.

You can install NEST® SDK using either npm or yarn. Use the following commands to install NEST® SDK:

npm install @nest25/ai-core-sdk
OR
yarn add @nest25/ai-core-sdk

Request

Here is an example of how to make a imageSimilarityTest request using the NEST® SDK:

// import the ai-core-sdk
import {AIServices} from '@nest25/ai-core-sdk';

// create a new instance of the sdk
const aiServices = new AIServices();

async function main() {
  // get the result of the test
  const result = await aiServices.imageSimilarityTest('https://ik.imagekit.io/BIOSPHERE/1678716455079_PTj9bkO9d.jpeg');
  console.log(result);
}

main();

Response

{
    "img": {
        "keyPoint1": "None",
        "keyPoint2": "None",
        "matchedImg": "None",
        "score": 2.0
    },
    "message": "Similar image found.",
    "status": 0
}

Last updated