I'm using Google Cloud Vision API to do OCR in images. Currency signs can prove to be very vital in solution to my problem
Problem that I encountered: Google Cloud Vision API fails to detect certain currency signs(Rupee(₹) in my case)
I tried running the API for this image in 2 ways
I wrote a python program for detection as per the reference: documentation
The output that I got
3. 己 AB 长 Rp CHF f Ft € も 元 Jy 手 le # 夫 %24
Clearly it is failing for some cases.
I tried the demo available on the website.
The output that I got
C A 요 한 ₹ Л В R p * C 元 C H F } F t m 元
with the bounding boxes as
I expected them to have the same outputs. The second one is able to detect Ruppe sign(₹) which I need. I cannot use the demo version in my project. It needs to run on batch of images. Is there any workaround by which I can detect currency sign in the script also.
Run it with Document_text_detection instead of text_detection
Related
In this tread it is explained how to download and merge tiles from a XYZ maps service.
How can I find out the X and Y values of a region defined by a special bounding box, e.g. 9.477733,53.485664,9.8856,53.602995 (CSV format)?
Am I right, that these values are the same for all XYZ maps services like Google Maps and OpenStreetMap?
Thanks for your answers!
Depends what you are trying to do. For a tile map server google and bing are not compatible with the TMS standards, You'll need to convert the values. In my case, I was using MapBox on my web app and GoogleMaps on mobile.
In my python server code I had to add an if statement that goes something like this:
#application.route('/your_url/<int:idx>/<int:zoom>/<int:column>/<int:row>.png')
def map_overlay(idx, zoom, column, row):
'''Retrievs a tile from s3 using TMS style tiling
'''
if request.args.get('mobile') == 'true':
row = (1 << zoom) - row - 1
For further info see Converting TMS to Google/Bing/OSM
Is it possible to trigger an HTTP cloud function in response to a pubsub message?
When editing a subscription, google makes it possible to push the message to an HTTPS endpoint, but for abuse reasons one has to be able to prove that you own the domain in order to do this, and of course you can't prove that you own google's own *.cloudfunctions.net domain which is where they get deployed.
The particular topic I'm trying to subscribe to is a public one, projects/pubsub-public-data/topics/taxirides-realtime. The answer might be use a background function rather than HTTP triggered, but that doesn't work for different reasons:
gcloud functions deploy echo --trigger-resource projects/pubsub-public-data/topics/taxirides-realtime --trigger-event google.pubsub.topic.publish
ERROR: gcloud crashed (ArgumentTypeError): Invalid value 'projects/pubsub-public-data/topics/taxirides-realtime': Topic must contain only Latin letters (lower- or upper-case), digits and the characters - + . _ ~ %. It must start with a letter and be from 3 to 255 characters long.
This seems to indicate this is only permitted on topics I own, which is a strange limitation.
It is possible to publish from a pub/sub topic to a cloud function. I was looking for a way to publish messages from a topic in project A to a function in project B. This was not possible with a regular topic trigger, but it is possible with http-trigger. Overall steps to follow:
Creata a http-triggered function in project B.
Create a topic in project A.
Create a push subscription on that topic in project A.
Domain verification
Push subscription
Here we have to fill in three things: the endpoint, the audience and the service account under which the function runs.
Push Endpoint: https://REGION-PROJECT_ID.cloudfunctions.net/FUNC_NAME/ (slash at end)
Audience: https://REGION-PROJECT_ID.cloudfunctions.net/FUNC_NAME (no slash at end)
Service Account: Choose a service account under which you want to send the actual message. Be sure the service account has the "roles/cloudfunctions.invoker" role on the cloud function that you are sending the messages to. Since november 2019, http-triggered functions are automatically secured because AllUsers is not set by default. Do not set this property unless you want your http function to be public!
Domain verification
Now you probably can't save your subscription because of an error, that is because the endpoint is not validated by Google. Therefore you need to whitelist the function URL at: https://console.cloud.google.com/apis/credentials/domainverification?project=PROJECT_NAME.
Following this step will also bring you to the Google Search Console, where you would also need to verify you own the endpoint. Sadly, at the time of writing this process cannot be automated.
Next we need to add something in the lines of the following (python example) to your cloud function to allow google to verify the function:
if request.method == 'GET':
return '''
<html>
<head>
<meta name="google-site-verification" content="{token}" />
</head>
<body>
</body>
</html>
'''.format(token=config.SITE_VERIFICATION_CODE)
Et voila! This should be working now.
Sources:
https://github.com/googleapis/nodejs-pubsub/issues/118#issuecomment-379823198,
https://cloud.google.com/functions/docs/calling/http
Currently, Cloud Functions does not allow one to create a function that receives messages for a topic in a different project. Therefore, specifying the full path including "projects/pubsub-public-data" does not work. The gcloud command to deploy a Cloud Function for a topic expects the topic name only (and not the full resource path). Since the full resource path contains the "/" character, it is not a valid specification and results in the error you see.
The error you are getting seems to be that you are misspelling something in the gcloud command you are issuing.
ERROR: gcloud crashed (ArgumentTypeError): Invalid value 'projects/pubsub-public-data/topics/taxirides-realtime': Topic must contain only Latin letters (lower- or upper-case), digits and the characters - + . _ ~ %. It must start with a letter and be from 3 to 255 characters long
Are you putting a newline character in the middle of the command?
Is this possible to get all items with their TAGS like
(Rarity,Quality,Hero,Slot,Type,Description)
for DOTA2(570), TF2(440), CS:GO(730), Steam(753)
I haven't found any api to get response with all items available for particular game.If anyone know how to get this please reply to my question.
There's no official API (e.g. the Web API) to get all information for all games. Web API only supports Dota 2 (IEconItem_570) and TF2 (IEconItems_440). There’s also an interface for CS:GO (IEconItem_730), but it's rudimentary and doesn't include weapon skins.
Because of that lack of official APIs Steam Condenser doesn't include a way to do this.
There's a way to mimic Steam's own web interface and mobile apps which use a JSON interface, e.g. http://steamcommunity.com/id/koraktor/inventory/json/730/2/ (where 730 is the app ID and 2 is the item type). Steam use other types than 2: 3, 6 and 7. The data structure is almost self-explanatory.
The language can be changed by setting the GET parameter l to the name of the language, e.g. english, german or french .
I have a need to send CTRL + Z to a Cisco device via TCL and Expect Scripting in order to get a prompt so that the scripting can perform an operation on the device. An example would be that if the script finds the state to be:
--MORE--
If you are sitting at the console you can send CTRL+Z and you will get:
#:
How can I do this from an automated script. I have tried:
send "\u001A";
and
send "\x1A";
They seem to be ignored.
--MORE-- in the cisco ios can also be get rid and return to the device prompt , if you send "q"
try it out manually on device and just send "q" to return to prompt..Hope it solves issue...
You should be able to find exactly what octal value your CTRL+Z has by using od (octal dump), and then sticking that in your script.
See a good explanation on how to determine that here:
http://expect.sourceforge.net/FAQ.html#q54
Other than that, I have to say that Vidiyal's suggestion (trying with Q instead of CTRL+Z) has merit, and is a lot simpler.
I have been trying for hours on how to exactly get the "billboard hot 100" chart (The results matching to http://www.billboard.com/#/charts/hot-100)...
but have had no success till yet.
I have gone through the API documentation at http://developer.billboard.com/docs thoroughly...
And from what i understand from here -> developer.billboard.com/docs/read/The_Chart_Service/Resources/Chart_Spec
"billboard hot 100" has id "379"
But when i use it in chart item call, like this -> api.billboard.com/apisvc/chart/v1/list?id=379&format=json&api_key=bvk4re5h37dzvx87h7rf5dqz
i just get an error :(
if anyone has experience using the api please help me...
Thanks
Update 2020-01-21
The RSS feed is now dead. You can view a historical snapshot of the feed at archive.org https://web.archive.org/web/2020*/http://www.billboard.com/rss/charts/hot-100.
However you will likely need to use web scraping to get the data now.
NodeJS scraper: https://github.com/darthbatman/billboard-top-100
The Billboard API seems to dead now with no sign of anyone maintaining it.
However they do provide a rss feed for the Hot 100 see http://www.billboard.com/rss/charts/hot-100. You might be able to get the information you need from that.
If you happen to know Python, check out billboard.py.
From the linked page:
pip install billboard.py
>>> import billboard
>>> chart = billboard.ChartData('hot-100')
>>> song = chart[0] # Get no. 1 song on chart
>>> song.title
u'One Dance'
>>> song.artist
u'Drake Featuring WizKid & Kyla'
>>> song.weeks # Number of weeks on chart
15
>>> song.spotifyID
u'11hqMWwX7sF3sOGdtijofF'
According to an entry on ProgrammableWeb, the Billboard API was officially terminated in May 2013.
As Matthew Moisen suggested above, try the Python module billboard.py. I just tried it a few minutes ago. While it's limited in fields (and maybe charts), it does provide basic data for at least the top-100 chart.
Here is the github repo: https://github.com/guoguo12/billboard-charts