vivithemage / mrisa Goto Github PK
View Code? Open in Web Editor NEWMRISA - Meta reverse image search api
Home Page: http://mrisa.mage.me.uk/
License: GNU General Public License v2.0
MRISA - Meta reverse image search api
Home Page: http://mrisa.mage.me.uk/
License: GNU General Public License v2.0
Respectfully
I have a question while using the program.
Can't I search by the image existing in the Local Driver?
curl -X POST -H "Content-Type: application/json" -d '{"image_url":"https://www.gstatic.com/tv/thumb/persons/62982/62982_v9_bb.jpg"}' http://localhost:5000/search
I'm executing the above command against the latest git master project.
it returns:
{"links": [], "descriptions": [], "titles": [], "similar_images": [], "best_guess": ""}
But if I put that into google image search it works fine.
https://www.google.com/search?tbs=sbi:AMhZZitiCNewtOPc0aO7m8G2SQsi4M7Z8nStXzlIFQBjyca-LbCqRtj3vT95FvyIFc6yC6Rn0iBuXkhcd8hmhr6padb1RaIfZlBQ4U9Mx1ijvmbA8cVUi2oqpVlDq6dZmRgxxnFF8hGoRRN_13b6SwcGOHv9eVvmODD3Py30yQ2ZKryiWmBFCm4xj8z3O-TbBL8i7bRo_1AZp79SqtXY_1uB08_1RxFx2BzLJOOYOSDC1k9sgOcEiDVOBD18cO24MwTO7l5d-z7JKAyL50OXUvvFZ3nhdtkOsMlVtOV9_1i2AA9gYP0dB6NS_1ViN6oTpUpvDK2ffUayDZLa7eBVx2YloenOS-ZxHSf4w6kg&hl=en
I'm getting this error
2020-12-23T06:30:41.158536+00:00 app[web.1]: time.sleep(0.1)
2020-12-23T06:30:41.158597+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2020-12-23T06:30:41.161138+00:00 app[web.1]: self.reap_workers()
2020-12-23T06:30:41.161147+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2020-12-23T06:30:41.161147+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2020-12-23T06:30:41.161148+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2020-12-23T06:30:41.226305+00:00 heroku[web.1]: Process exited with status 1
2020-12-23T06:30:41.274154+00:00 heroku[web.1]: State changed from starting to crashed
2020-12-23T06:30:41.979806+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=image-c2.herokuapp.com request_id=c3d02f51-1371-410e-bdd4-030d3c511a03 fwd="146.196.32.201" dyno= connect= service= status=503 bytes= protocol=https
2020-12-23T06:30:43.227663+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=image-c2.herokuapp.com request_id=3de42211-6971-482c-a463-7263257ff74f fwd="146.196.32.201" dyno= connect= service= status=503 bytes= protocol=https
if you have already deployed somewhere then let me know
A full file path has been used here, this will definitely create issues as not everyone have the same system path
The following code is from the server script. You may want to add to the client script or do the replacements listed.
I don't know if io works with older python versions, so for dual compatibility, the 'try' code may be better. Unfortunately, there's no 'PyVer' version reconciliation module to treat compatibility issues.
Seems like a 'no brainer'.
CODE
try:
from StringIO import StringIO
except ImportError:
python3 = True
import io as bytesIOModule
END CODE
Replace :
storage = StrinIO.StrinIO()
with :
storage = io.BytesIO()
and
import io instead of StringIO
additionally
add parentheses for print statement.
The suggestion:
if possible, add the section on Google's return page, entitlesd "Pages that include matching images."
This would create the possibility of searching for larger format images, e.x. 2048x1024.
Hello, I like your tool!
I see that you are scraping google results to return to the user. From what I understand any app that is doing this with a steady amount of traffic will get shut down pretty quickly by Google.
I haven't been able to find a google api to do the reverse image search for me - have you looked into that at all? I assume yes and you didn't find anything either :)
phanirithvij/mrisa
to vivithemage/mrisa
I am having problems with the Server.py. Every time I am trying to install the requirements,
ERROR: Could not find a version that satisfies the requirement pycurl==7.19.5
ERROR: No matching distribution found for pycurl==7.19.5
and when I want to send a request, it only returns an Error code <Response [500]>.
The Error I get in the Server
Hi @vivithemage . I'm a graphic designer and an open source enthusiast. I would like to contribute to your project by proposing a logo design. If you have an idea please share with me, it would be better for me. Thanks
Best Regard. Mirza Zulfan
When calling to https://cxl-services.appspot.com/proxy?url=https%3A%2F%2Fvision.googleapis.com%2Fv1%2Fimages%3Aannotate, it says Bad Request
and gives Response Code 400
.
Hi,
I've got the server successfully running on http://0.0.0.0:5000/ but when I try making a POST request, I get the following error:
<title>500 Internal Server Error</title>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
I just tried the sample request in the docs to try it out.
Any suggestions on how to get it working? Thanks!
https://github.com/dessant/search-by-image
@vivithemage Please have a look at this extension it has yandex and baidu, tinyeye, pinterest etc.. image searches.
P.S:
I have exams now so I won't be able to create a pull request in the near future I'd happily implement these if you don't want to, after a week or two.
Not so much an issue as a question/request.
I've gotten the software running after some work.
I had to use io.BytesIO() instead of io.StringIO().
I'm using Windows 10 Pro x64 with the Debian Strtetch Linux subsystem installed with curl added on.
Everythings working, but I need to use images in my Apache htdocs directory, or some other local path.
I tried Dropbox, but direct links to files is not possible.
Any help is appreciated. I'm trying to identify over 2000 works of art extracted from a video file.
I want to use this tool by all means this program.
Traceback (most recent call last):
File "example1.py", line 13, in
r = requests.post(url, headers=headers, data=json.dumps(data))
File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/requests/api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/requests/sessions.py", line 524, in request
resp = self.send(prep, **send_kwargs)
File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/requests/sessions.py", line 637, in send
r = adapter.send(request, **kwargs)
File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: /search (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x104c1fa90>: Failed to establish a new connection: [Errno 61] Connection refused',))
(j16134uk) EUNHYUKui-MacBook-Pro:python eunhyulkim$
I discovered some problems in the json files I created from returned data using a modified form of the 'client.py' file.
All json files begin with the letter 'b' and a single quote. Each file ends with a single quote. In between are several unicode characters and escaped characters. Examples are:
'
\
u\00a0
u\00d7
If the iinitial b and single quote are removed, along with the trailing quote, all '\' become ''
and all escaped apostrophes have the back slash removed, then the file is accepted as a json file.
Question is, can these chartacters be removed easily? I'm only vaguely familiar with python string types
and unicode, ASCII, and byte conversions. I could write a script to remove the examples, but is that all that will ever be ever found?
Is it possible to make that reverse image search would be made against private database of images?
After around ~140-160 requests Bestguess will be empty for all following requests but if you wait a while (some hours) it works again, i would guess it might be a ratelimit or hidden captcha thing from google.
I think Yandex is cool.
I am suggesting of adding an option to choose between providers (search engines)
But Yandex has no Best_Guess
{
"image_url":"IMAGE_URL",
"yandex":true,
"google":true
}
URL_FORMAT
: https://www.yandex.com/images/search?
+
text=IMAGE_URL
& +
img_url=IMAGE_URL
& +
rpt=imageview
Where IMAGE_URL
is escaped
I coudln't tell from the README what version of Python is required for this. I don't see a virtualenv in the download, and when I tried installing via what the README recommended, I got this error
localhost:mrisa-master davea$ pip install -r requirements.txt
ImportError: No module named site
I'm running the python example and can see that the server is indeed running and reacting to calls.
I seem to be getting errors related to json:
$ python3 mrisa.py
Traceback (most recent call last):
File "/Users/Greg/Projects/Python/GoogleImageSearch/mrisa.py", line 36, in <module>
print(r.json())
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I'm using the docker image, although I may be messing that up.
How to troubleshoot?
I've downloaded the zip file and ran the server and all seems to be okay. But when I paste the localhost url to my browser it gives me a 404. How do I get this going?
I already have my own modified version that works, so I can supply you with it if you want to modernize this up a bit :)
Does this tool complies with Google's Terms of Service? I'm thinking about using it in a project, looks very nice. Thanks!
I receive a ConnectionRefusedError when trying to send a POST request to the server running locally on Windows.
Always returns an empty dictionary on any request.
{'links': [], 'descriptions': [], 'titles': [], 'similar_images': [], 'best_guess': ''}
Fails when pushing image to docker registry.
Please see: https://github.com/vivithemage/mrisa/actions/runs/904301756
I don't know what to do after running src/server.py and getting confused about the next step
Respectfully,
Can you help me?
I have a problem right now, but I can't find the cause
I've tried installing Python 2 and 3 several times, but both get errors
At run time,
python example.py
(eun) EUNHYUKui-MacBook-Pro:python eunhyulkim$ python example.py
Traceback (most recent call last):
File "example.py", line 12, in
r = requests.post(url, headers=headers, data=json.dumps(data))
File "/Users/eunhyulkim/opt/anaconda3/envs/eun/lib/python2.7/site-packages/requests/api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "/Users/eunhyulkim/opt/anaconda3/envs/eun/lib/python2.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/eunhyulkim/opt/anaconda3/envs/eun/lib/python2.7/site-packages/requests/sessions.py", line 524, in request
resp = self.send(prep, **send_kwargs)
File "/Users/eunhyulkim/opt/anaconda3/envs/eun/lib/python2.7/site-packages/requests/sessions.py", line 637, in send
r = adapter.send(request, **kwargs)
File "/Users/eunhyulkim/opt/anaconda3/envs/eun/lib/python2.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: /search (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10d52f3d0>: Failed to establish a new connection: [Errno 61] Connection refused',))
At run time, server.py
(eun) EUNHYUKui-MacBook-Pro:src eunhyulkim$ python server.py
and
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.