iris-image-index-demo


Downloads17
Follow
0
Star
0
Details
Releases
Reviews
Issues
This application is not supported by InterSystems Corporation. Use it at your own risk.

What's new in this version

Installation documentation fix

iris-image-index-demo

A demo on how to build a custom SQL index for images data type.

Project description

This project implements a demo on how to extend base classes of InterSystem IRIS in order to create a custom SQL index for a column that points to images. Thus, you can perform SQL queries using images content in the query predicates.

For instance, you can search for images which are similar to an example one, using a custom color similarity operator:

SELECT %DLIST(ImageFile) AS similarImagesList 
FROM dc_multimodel_ImageIndex.Test 
WHERE ID %FIND search_index(idxImageFile, '{"color_similarity":{"image":"/data/img/test/161074693598711.jpg","first":5}}')

As an example of application for this custom index, a simple query interface UI was created. In such application, you can dynamically select an example image and see the custom SQL index in action:

You can also execute SQL statements normally in portal:

Technologies used:

In order to create a custom SQL index, the %Library.FunctionalIndex and %SQL.AbstractFind interfaces was implemented.

For image feature extraction, the new IRIS Embedded Python technology was used. Such technology allows you to execute Python code directly from a COS context.

Internally, image features are stored in key-value model (globals). When a SQL query using the image index is performed, the features of the input image is extracted and compared to fetures stored in the index global.

This way, you can boost IRIS infrasctructures - acessed througth COS, using Python's advanced libs to delivere exciting features.

As an example of such IRIS infrastructure, this project combines IRIS custom index framework and multi model capabilities with Python image analysis libs.

Installation

Clone/git pull the repo into any local directory

$ git clone https://github.com/jrpereirajr/iris-image-index-demo.git

Open a Docker terminal in this directory and run:

$ cd iris-image-index-demo
$ docker-compose up
  1. Wait for backend container to up and then build the frontend (in a new terminal instance):
cd iris-image-index-demo
cd frontend
npm i
npx ng serve
  1. Access the application. Username: superuser; password: SYS.

Installation (ZPM)

Open Terminal and call:

USER> zpm "install iris-image-index-demo"

Credits

This project was inspired in the work presented by Alexander Koblov about how to implement a custom SQL index for geospatial coordinates. The projects iris-sample-rest-angular and Cache-FileServer are used for angular and REST template. For IntegratedML and Python features, this project uses integratedml-demo-template project.

ZPM installation
zpm "install iris-image-index-demo"
Rating
0 (0)
Category
Technology Example
Works with
InterSystems IRIS
Tags
Info
Version
1.0.1
Last updated
2021-01-24
Repository
Open
Documentation
Open
License
Link