Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,208,954 members, 8,004,454 topics. Date: Saturday, 16 November 2024 at 04:26 PM

Programmers How Can I Achieve This - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Programmers How Can I Achieve This (1334 Views)

Programmers, How Do You Solve Power Issue / Programmers, How Do You Cope With Generator Noise In Your Area? / Programmers how much do you earn monthly? (2) (3) (4)

(1) (Reply) (Go Down)

Programmers How Can I Achieve This by AllyPolly: 5:08pm On Apr 28, 2022
Hello all,
Please I need help with a particular task that has been bothering me for a while.

It is about image search.

I want users to upload an image, the system will then search the database for the most similar images to the uploaded image. Then it outputs them. Similar to google lens.

Is this achievable in PHP, if not, how can I do this?

Thank you.
Re: Programmers How Can I Achieve This by devdev: 5:25pm On Apr 28, 2022
AllyPolly:
Hello all,
Please I need help with a particular task that has been bothering me for a while.

It is about image search.

I want users to upload an image, the system will then search the database for the most similar images to the uploaded image. Then it outputs them. Similar to google lens.

Is this achievable in PHP, if not, how can I do this?

Thank you.
First and easy Solution. You can Tag the images while uploading. Example, while uploading a food image, you can tag it as FOOD. So when next a user uploads an image with similar Tag, you fetch other images with similar Tags.
Second solution is developing an image detection Ai.
Re: Programmers How Can I Achieve This by Nobody: 5:41pm On Apr 28, 2022
devdev:

First and easy Solution. You can Tag the images while uploading. Example, while uploading a food image, you can tag it as FOOD. So when next a user uploads an image with similar Tag, you fetch other images with similar Tags.
Second solution is developing an image detection Ai.
Your approach is good but it's not optimal and basically won't work
Re: Programmers How Can I Achieve This by Nobody: 5:44pm On Apr 28, 2022
If u want it to choose from your own database youll have to spend alot of money, use machine learning to train a model to recognise things based on their geometry like how facial recognition works, basically you feed it alot of let's say mango pics so if it sees a mango it understands it's a mango so what ur trying to build is a waste of resources cuz to use that amount of computing power needs alot of money
Re: Programmers How Can I Achieve This by emetisuccess(m): 5:53pm On Apr 28, 2022
If searching for the name in the database, it will be very easy to do that, but searching for the actual image itself needs an AI related algorithm. If the later is the case, it's not possible with PHP. Thanks boss

1 Like

Re: Programmers How Can I Achieve This by devdev: 7:00pm On Apr 28, 2022
Jayjayango:

Your approach is good but it's not optimal and basically won't work
I gave two approaches and trust me the first one works too. Tech giants like facebook and instagram uses hashtags to associate related posts. Same as ecommerce platforms like jumia. The use of Tags and Categories works well. I see no reason why he should go spend millions just for a simple image upload on website. I only gave him the second solution as an option which to me is not necessary for a simple task as this.

1 Like

Re: Programmers How Can I Achieve This by devdev: 7:02pm On Apr 28, 2022
emetisuccess:
If searching for the name in the database, it will be very easy to do that, but searching for the actual image itself needs an AI related algorithm. If the later is the case, it's not possible with PHP. Thanks boss
He asked for similar images not exact images which tags will definitely work. Why would he need an AI just to search for similar uploads on his website
Re: Programmers How Can I Achieve This by Nobody: 7:22pm On Apr 28, 2022
devdev:

I gave two approaches and trust me the first one works too. Tech giants like facebook and instagram uses hashtags to associate related posts. Same as ecommerce platforms like jumia. The use of Tags and Categories works well. I see no reason why he should go spend millions just for a simple image upload on website. I only gave him the second solution as an option which to me is not necessary for a simple task as this.
No like what I'm saying is for example the user uploads the picture of a mango, first of all how will the system know which tag to give it? If the user manually puts the tag then what's the use of the image? Even if let's say u fix that then if the user uploads a banana with the tag food, mind you food isn't just banana, he might see a full course amala meal but then what's the relevance? A fundamentally flawed system I might say and the social media giants use it because that's a totally different case that doesn't need to be precise just simply Grouping things and even then I might post a dick and hashtag Vacation so...
Re: Programmers How Can I Achieve This by devdev: 7:49pm On Apr 28, 2022
Jayjayango:

No like what I'm saying is for example the user uploads the picture of a mango, first of all how will the system know which tag to give it? If the user manually puts the tag then what's the use of the image? Even if let's say u fix that then if the user uploads a banana with the tag food, mind you food isn't just banana, he might see a full course amala meal but then what's the relevance? A fundamentally flawed system I might say and the social media giants use it because that's a totally different case that doesn't need to be precise just simply Grouping things and even then I might post a dick and hashtag Vacation so...
Even when you search an image on google, google does not bring you images stored in thier database. It's gives you images indexed from websites and blogs and these search is related to the text SEOs of these websites and when you check you still find some unrelated images in that search. We all know there will surely be a flaw but it wont be at 100%. If you post a banana and you don't know banana is a fruit then it's funny. To assist a user, the OP can add suggested and custom tag for users to choose from. I see no need going the AI route for this simple task.

2 Likes

Re: Programmers How Can I Achieve This by Nobody: 8:47pm On Apr 28, 2022
devdev:

Even when you search an image on google, google does not bring you images stored in thier database. It's gives you images indexed from websites and blogs and these search is related to the text SEOs of these websites and when you check you still find some unrelated images in that search. We all know there will surely be a flaw but it wont be at 100%. If you post a banana and you don't know banana is a fruit then it's funny. To assist a user, the OP can add suggested and custom tag for users to choose from. I see no need going the AI route for this simple task.
Okay let's get technical here, for SEO you specifically tag an image with exactly what it is, for his application it doesn't have the plethora of sources Google has and he can't tag everything, if u search using Google lens it doesn't use tags mate, it uses recognition based on ML patterns so everyday their accuracy is ever increasing but that aside basically the application he is trying to build is not feasible the way he wants it unless of course he connects google lens to it I'm not even sure Google lens has an API but perhaps it might
Re: Programmers How Can I Achieve This by devdev: 8:55pm On Apr 28, 2022
Jayjayango:

Okay let's get technical here, for SEO you specifically tag an image with exactly what it is, for his application it doesn't have the plethora of sources Google has and he can't tag everything, if u search using Google lens it doesn't use tags mate, it uses recognition based on ML patterns so everyday their accuracy is ever increasing but that aside basically the application he is trying to build is not feasible the way he wants it unless of course he connects google lens to it I'm not even sure Google lens has an API but perhaps it might
You are getting his request wrong. At the moment he is developing. He is not asking to get related image from outside sources. He is asking to search his own database for related images, meaning if he has zero images in his database he will not display anything. He is only working with his own data. So gradually he will use the tag to keep building his database. The users uploading these images are the ones to tag them during upload. So no need of getting related images from google. And for the googles lens even the AI is not very accurate as i have used and got something completely different from what i used it for

2 Likes

Re: Programmers How Can I Achieve This by Nobody: 9:44pm On Apr 28, 2022
devdev:

You are getting his request wrong. At the moment he is developing. He is not asking to get related image from outside sources. He is asking to search his own database for related images, meaning if he has zero images in his database he will not display anything. He is only working with his own data. So gradually he will use the tag to keep building his database. The users uploading these images are the ones to tag them during upload. So no need of getting related images from google. And for the googles lens even the AI is not very accurate as i have used and got something completely different from what i used it for
But what's the point of uploading the image? I can just tag the related info and get what I want, I think your the one not getting his request
Re: Programmers How Can I Achieve This by AllyPolly: 9:44pm On Apr 28, 2022
Thank you all for the reply,

Here is a scenario. A customer needs a particular product but he doesn't know the name of the product(so text search/tag might not work) but he has an image of the product.

I want the user to upload the image and the system then searches the database for most similar product image.
Re: Programmers How Can I Achieve This by devdev: 9:51pm On Apr 28, 2022
AllyPolly:
Thank you all for the reply,

Here is a scenario. A customer needs a particular product but he doesn't know the name of the product(so text search/tag might not work) but he has an image of the product.

I want the user to upload the image and the system then searches the database for most similar product image.
Good thing you clarified your request. You can use this service https://www.nyckel.com/image-similarity-search-api?gclid=CjwKCAjw9qiTBhBbEiwAp-GE0ce3Z8ZIznC4Y2ovQ-EsIcjfQxei3b_5gN14_XqZIrkCs8xprVpL5xoC8k0QAvD_BwE

1 Like

Re: Programmers How Can I Achieve This by Nobody: 10:30pm On Apr 28, 2022
Look for an api and use


You yourself can't code it

2 Likes

Re: Programmers How Can I Achieve This by AllyPolly: 7:34am On Apr 29, 2022
devdev:

Good thing you clarified your request. You can use this service https://www.nyckel.com/image-similarity-search-api?gclid=CjwKCAjw9qiTBhBbEiwAp-GE0ce3Z8ZIznC4Y2ovQ-EsIcjfQxei3b_5gN14_XqZIrkCs8xprVpL5xoC8k0QAvD_BwE
Thanks devdev. I have checked it out and it seems to be the perfect option for the task.
I checked online for proper video illustration on how to set it up but can't find any.

Can you please help with this? I could also pay a little for this to compensate your time. PLEASE.
Re: Programmers How Can I Achieve This by devdev: 9:01am On Apr 29, 2022
AllyPolly:

Thanks devdev. I have checked it out and it seems to be the perfect option for the task.
I checked online for proper video illustration on how to set it up but can't find any.

Can you please help with this? I could also pay a little for this to compensate your time. PLEASE.
Chat me 081
Re: Programmers How Can I Achieve This by AllyPolly: 9:58am On Apr 29, 2022
Still open for other suggestion or solution.
Re: Programmers How Can I Achieve This by Nobody: 4:23pm On Apr 29, 2022
devdev:

He asked for similar images not exact images which tags will definitely work. Why would he need an AI just to search for similar uploads on his website
Your suggestion is very practical bro, and should work to a very large extent. Any other solution would require AI, and that’s a different topic altogether.

1 Like

Re: Programmers How Can I Achieve This by devdev: 4:30pm On Apr 29, 2022
Rgade:

Your suggestion is very practical bro, and should work to a very large extent. Any other solution would require AI, and that’s a different topic altogether.
Thanks bro
Re: Programmers How Can I Achieve This by satandeterrible: 11:10am On Apr 30, 2022
This is easy.
You can write a program to compare the images in many ways. This might include comparing the checksum or converting the images to binary and then do a raw comparison of them.

You can then set parameters for similarities, depending on the relationships between the different checksums of the files, or how varied the images are when compared in binary.

If you website is being hosted on a Linux system, you can fetch the images from the database whenever the request is made, then write either a bash script or a C++ program to perform this comparison. Then upload the results back to the database.

1 Like

Re: Programmers How Can I Achieve This by monikulapo: 11:33am On Apr 30, 2022
You could use tensorflow to train your app on your images and display a search on your app. You can whip one up using python. As devdev said you would also use tags and tbh that should be your first considerations (if this is for a business. So you can test out the idea before going fully in the ML route), then you can incrementally improve your tags before promising heaven coz you’re going to need that after you train the AI. Think of tags as what the AI sees when you upload a media asset so exploring that lazy mango example. There’s more properties to a mango - type, color, volume even meta data such as location, date etc that can be assigned to an object. This is a gross simplification but a current grad student should be able to make you a good app. There are also lots of credible resources on the internet.
Re: Programmers How Can I Achieve This by monikulapo: 11:35am On Apr 30, 2022
Jayjayango:

Okay let's get technical here, for SEO you specifically tag an image with exactly what it is, for his application it doesn't have the plethora of sources Google has and he can't tag everything, if u search using Google lens it doesn't use tags mate, it uses recognition based on ML patterns so everyday their accuracy is ever increasing but that aside basically the application he is trying to build is not feasible the way he wants it unless of course he connects google lens to it I'm not even sure Google lens has an API but perhaps it might
The dude you’re contesting with is actually right and if you did a little bit of research you’ll see he’s more experienced than you. Respect a little man.
Re: Programmers How Can I Achieve This by Nobody: 12:01pm On Apr 30, 2022
monikulapo:

The dude you’re contesting with is actually right and if you did a little bit of research you’ll see he’s more experienced than you. Respect a little man.
Nah bruv you don't understand what I meant, he is right it can be done but what I'm saying is that it's not optimal since the user will just input the image and will not tag it so how will the system know what tag it is if the user doesn't tag it? That's where my argument comes from and yes he is more experienced than me but that doesn't mean he can't make mistakes
Re: Programmers How Can I Achieve This by monikulapo: 12:11pm On Apr 30, 2022
Jayjayango:

Nah bruv you don't understand what I meant, he is right it can be done but what I'm saying is that it's not optimal since the user will just input the image and will not tag it so how will the system know what tag it is if the user doesn't tag it? That's where my argument comes from and yes he is more experienced than me but that doesn't mean he can't make mistakes

You need to initially train it with your own images or you use numerous other APIs out there. He mentioned it in his initial post. Sorry, I didn’t mean to be dismissive, what I implied is that it seems (>50% chance) that he’s on the right path considering his suggestion and post history.
Re: Programmers How Can I Achieve This by Nobody: 12:15pm On Apr 30, 2022
monikulapo:


You need to initially train it with your own images or you use numerous other APIs out there. He mentioned it in his initial post. Sorry, I didn’t mean to be dismissive, what I implied is that it’s likely he’s on the right path considering his suggestion and post history.
Ohk I understand I think it's a misunderstanding on my side about what he said at first
Re: Programmers How Can I Achieve This by Deicide: 8:22pm On May 01, 2022
Store the image with their "Hash"
Re: Programmers How Can I Achieve This by AllyPolly: 7:23am On May 02, 2022
Deicide:
Store the image with their "Hash"
Thanks. Please can you give a little illustration on how this works or point me to a good resource that could be of help?

(1) (Reply)

Lets Build Your Website/app At Giveaway Price / Cost Of Software Enterpreneurship Programme? / Help! Uploading Pictures

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 55
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.