This is a python appengine question, mapreduce library 1.9.21 .
I have code writing lines to a blob in the local blobstore, then processing that using mapreduce BlobstoreLineInputReader.
Given that the files api is going away, I thought I'd retarget all my processing to cloud storage.
I would expect to find a class called GoogleCloudStorageLineInputReader, but there isn't anything like that. Is it hiding somewhere?
Is there something way I can use GoogleCloudStorageInputReader to read lines?
Another possibility is using GoogleCloudStorageRecordInputReader, but for that my input file needs to be in LevelDB format and I don't know how to create that except with a GoogleCloudStorageConsistentRecordOutputWriter, which I don't know how to use outside a mapreduce context. How might I do that?
Or am I doing this all wrong, is there some other possibility I've missed?
At first, I attempted thinkjson's CloudStorageLineInputReader but had no success.
Then I found this pull request...which led me to rbruyere's fork. Despite some linting issues (like the spelling on GoolgeCloudStorageLineInputReader), however at the bottom of the pull request it is mentioned that it works fine, and asks if the project needs to be taken over.
Hope that helps!
I have tried searching this multiple times and came across no simple resources.
Lets say I have a single URL and I want to search for all images that look the same as said image (let's say <98% similarity, for arguments sake).
I simply want to return the number of images that look the same as my original, that is all.
I have searched Google multiple times ,but found no convenient way for me to do this using. I would preferably like to use Python, but if this is not possible it would be perfect if I could just use the method call in a Python program.
Is it possible? How?
You can search for all images you have through google image search engine simply, because Google has been providing us with their own APIs like
https://ajax.googleapis.com/ajax/services/search/images
And I found related article on stackoverflow, just take a look at python search with image google images
This is a problem more suitable for a web-service to perform. Tineye.com is a reverse image search, and I suspect that you can use curl to send a http request to this web service, and use e.g. BeautifulSoup to extract the number of matches.
I need some image sample for machine learning training. I have not enough resource now, so I need to crawl some using the search engine. Google is not free now and I choose bing.
I have tried pybing. It seems not work now.
I don't known how to get the appid.
from py_bing_search import PyBingImageSearch
bing_image = PyBingImageSearch('Your-Api-Key-Here', "x-box console", image_filters='Size:medium+Color:Monochrome') #image_filters is optional
first_fifty_result= bing_image.search(limit=50, format='json') #1-50
print (first_fifty_result[0].media_url)
I am trying to rename the images in my massive pictures folder by searching google images by each image and naming them the result next to "Best guess for this image: ". I understand that google does have a python API but I am unsure if it can be used in this way, or if that is a reasonable project for someone of my limited experience.
https://developers.google.com/appengine/docs/python/images/usingimages#Uploading seems to be helpful but I'm not sure I understand what I need to be doing conceptually.
Another option is to use the drag-and-drop feature but I have not looked into that as much.
Thanks in advance for any guidance.
As far as I know, Google still doesn't offer a public API for its reverse image search service (i.e. you send a picture and get textual search results).
The most popular alternative that I know is TinEye ( http://www.tineye.com/ ). Here's a link to their RESTful API: http://services.tineye.com/TinEyeAPI
I have a website where i want to put a custom made captcha, can't use online captcha services due to layout needs. It runs on google appengine.
Does appengine API has a something for writing characters on a given image?
I went through appengine Python Image API but it doesnot seems to be of much help.
Any suggestions how to generate captcha on google appengine infrastructure?
A quick google search will provide you with plenty of guides for integrating captch services with your AppEngine application. Here's one that uses reCaptcha.
Generally, you can't.
The Image API is designed for transforming existing images, not generating new ones.
Theoretically if you found a pure Python image creation library it would run on App Engine, but it would be slow.
Why not just leverage an external CAPTCHA service?
Instead of creating your own impl. I recommend using a reliable service like reCaptcha:
http://www.google.com/recaptcha
I would suggest using a third-party service like reCaptcha, but in case you really need to provide your own implementation, you could use the recently introduced Matplotlib for GAE+Python to generate your own images.
Matplotlib is a plotting library for Python, and was recently introduced as part of GAE on December of 2012. You can use Matplotlib to render text as shown in this example. If you have aesthetic constraints on your captcha, you can render very fancy text and numbers with Matplotlib. Look at this example.
You can use following code to create Captcha, Please note you have to add commons-lang-2.5.jar in your classpath.
String secutiryCode = RandomStringUtils.random(5, new char[]{'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'});
req.getSession().setAttribute("secutiryCode", secutiryCode);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
URL url = new URL("http://util.krispot.com/util/SecurityImage.jpg?secutiryCode=" + secutiryCode);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
BufferedInputStream bis = new BufferedInputStream(connection.getInputStream());
for(int i = bis.read(); i > -1;i = bis.read()) {
baos.write(i);
}
BufferedOutputStream bos = new BufferedOutputStream(resp.getOutputStream());
bos.write(baos.toByteArray());
bos.close();
Thank you,
Navdeep Singh