Code Monkey home page Code Monkey logo

Comments (11)

alexklibisz avatar alexklibisz commented on May 13, 2024

You can update the mapping independent of elastiknn, using the regular REST API.
For example:

  1. Create an index using the elastiknn client. This will have a mapping that contains an elastiknn_vector field.
  2. Use the PUT Mapping API to add another field.

You don't have to use the client at all for index creation. It's just a convenience. You can create the index using the REST API and then also use the REST API to PUT a mapping that contains an elastiknn_vector field.

from elastiknn.

zhenzi0322 avatar zhenzi0322 commented on May 13, 2024

You can update the mapping independent of elastiknn, using the regular REST API.
For example:

  1. Create an index using the elastiknn client. This will have a mapping that contains an elastiknn_vector field.
  2. Use the PUT Mapping API to add another field.

You don't have to use the client at all for index creation. It's just a convenience. You can create the index using the REST API and then also use the REST API to PUT a mapping that contains an elastiknn_vector field.

I use the L2 function to search for images.Where are the scores of the two most similar pictures?Through the data I looked up, I observed many different pictures with very similar scores

from elastiknn.

zhenzi0322 avatar zhenzi0322 commented on May 13, 2024

You can update the mapping independent of elastiknn, using the regular REST API.
For example:

  1. Create an index using the elastiknn client. This will have a mapping that contains an elastiknn_vector field.
  2. Use the PUT Mapping API to add another field.

You don't have to use the client at all for index creation. It's just a convenience. You can create the index using the REST API and then also use the REST API to PUT a mapping that contains an elastiknn_vector field.

How do you convert an image to the original image pixel?What python library are you using?, I used the feature vector to achieve the similar effect between the pictures, the effect is not ideal

from elastiknn.

alexklibisz avatar alexklibisz commented on May 13, 2024

You can update the mapping independent of elastiknn, using the regular REST API.
For example:

  1. Create an index using the elastiknn client. This will have a mapping that contains an elastiknn_vector field.
  2. Use the PUT Mapping API to add another field.

You don't have to use the client at all for index creation. It's just a convenience. You can create the index using the REST API and then also use the REST API to PUT a mapping that contains an elastiknn_vector field.

I use the L2 function to search for images.Where are the scores of the two most similar pictures?Through the data I looked up, I observed many different pictures with very similar scores

There's no method to find the two most similar images directly in the plugin. You can loop over all of the documents in your index, compute the nearest neighbors for each one, and keep track of the max score.

from elastiknn.

alexklibisz avatar alexklibisz commented on May 13, 2024

You can update the mapping independent of elastiknn, using the regular REST API.
For example:

  1. Create an index using the elastiknn client. This will have a mapping that contains an elastiknn_vector field.
  2. Use the PUT Mapping API to add another field.

You don't have to use the client at all for index creation. It's just a convenience. You can create the index using the REST API and then also use the REST API to PUT a mapping that contains an elastiknn_vector field.

How do you convert an image to the original image pixel?What python library are you using?, I used the feature vector to achieve the similar effect between the pictures, the effect is not ideal

I think you are asking how to store the original image and the feature vector? If that's the case, I would recommend two options:

  1. Store the images in another storage system, like S3 or some directory on your computer. Then store a reference to the original image in the document. For example, have a field called image_name that contains "my-image-123.jpg".
  2. Store the original image in elasticsearch as a base64-encoded string.

Generally option 1 is better than option 2 because option 2 uses much more space in elasticsearch.

from elastiknn.

zhenzi0322 avatar zhenzi0322 commented on May 13, 2024

You can update the mapping independent of elastiknn, using the regular REST API.
For example:

  1. Create an index using the elastiknn client. This will have a mapping that contains an elastiknn_vector field.
  2. Use the PUT Mapping API to add another field.

You don't have to use the client at all for index creation. It's just a convenience. You can create the index using the REST API and then also use the REST API to PUT a mapping that contains an elastiknn_vector field.

How do you convert an image to the original image pixel?What python library are you using?, I used the feature vector to achieve the similar effect between the pictures, the effect is not ideal

I think you are asking how to store the original image and the feature vector? If that's the case, I would recommend two options:

  1. Store the images in another storage system, like S3 or some directory on your computer. Then store a reference to the original image in the document. For example, have a field called image_name that contains "my-image-123.jpg".
  2. Store the original image in elasticsearch as a base64-encoded string.

Generally option 1 is better than option 2 because option 2 uses much more space in elasticsearch.

Have you adopted elasticsearch to achieve similar figure search for project reference?

from elastiknn.

alexklibisz avatar alexklibisz commented on May 13, 2024

Have you adopted elasticsearch to achieve similar figure search for project reference?

I used option 1 to implement this example: http://demo.elastiknn.klibisz.com/dataset/cifar-l2
This is the code used to generate the documents which include the base64-encoded images: https://github.com/alexklibisz/elastiknn/blob/master/examples/demo/indexer/index.py#L72-L84
This is the code which indexes the documents: https://github.com/alexklibisz/elastiknn/blob/master/examples/demo/indexer/index.py#L118-L125

from elastiknn.

zhenzi0322 avatar zhenzi0322 commented on May 13, 2024

Have you adopted elasticsearch to achieve similar figure search for project reference?

I used option 1 to implement this example: http://demo.elastiknn.klibisz.com/dataset/cifar-l2
This is the code used to generate the documents which include the base64-encoded images: https://github.com/alexklibisz/elastiknn/blob/master/examples/demo/indexer/index.py#L72-L84
This is the code which indexes the documents: https://github.com/alexklibisz/elastiknn/blob/master/examples/demo/indexer/index.py#L118-L125

I'm not very good at generating base64 encoded images using what you said, and I can't index documents.I installed the dependent libraries first and then ran the index.py file

from elastiknn.

alexklibisz avatar alexklibisz commented on May 13, 2024

from elastiknn.

zhenzi0322 avatar zhenzi0322 commented on May 13, 2024

I see. I can try to make a simple image search tutorial in a jupyter notebook. I think it will be a common usecase. But right now I'm on vacation so that would be next week at the earliest.

On Wed, May 27, 2020, 01:33 zhenzi @.***> wrote: Have you adopted elasticsearch to achieve similar figure search for project reference? I used option 1 to implement this example: http://demo.elastiknn.klibisz.com/dataset/cifar-l2 This is the code used to generate the documents which include the base64-encoded images: https://github.com/alexklibisz/elastiknn/blob/master/examples/demo/indexer/index.py#L72-L84 This is the code which indexes the documents: https://github.com/alexklibisz/elastiknn/blob/master/examples/demo/indexer/index.py#L118-L125 I'm not very good at generating base64 encoded images using what you said, and I can't index documents.I installed the dependent libraries first and then ran the index.py file — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#70 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5E27H4TLXH27NGSHD4ATDRTS645ANCNFSM4NIHLFTQ .

Ok, so I just want to know that the image is similar and the eyes look a little bit similar.But the images I searched for using the elastiknn plugin didn't look the same

from elastiknn.

alexklibisz avatar alexklibisz commented on May 13, 2024

@yu258 I made an issue for adding an image search example in Python: #71
I'm going to close this issue. Feel free to comment/re-open if you need.

from elastiknn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.