Use OCR on a file located in Google Cloud Storage - google-apis-explorer

I performed a few tests with OCR using image upload but would like to use OCR with remote images. These images are located in Google storage and yet I have the following error:
image-annotator::error(10): Can not open file: gs://my_sample_api.appspot.com/my_sample_image.jpg
Here is the documentation related: https://cloud.google.com/vision/docs/detecting-fulltext
Any idea? Thanks

Related to Firebase free plan limitation, difficult to find however since no log was provided...

Related

Google Colab API

Is there a Google Colab API? I'm looking to accomplish things like:
Create users
Create notebooks
Share notebooks with users
Retrieve the contents of a notebook
As pointed out in the other answer, Colab Notebooks are files on your Google Drive. Hence, sharing them or retrieving their contents can be done via the Google Drive API (from what I understand you can use the webContentLink to download it).
However, your first question is:
Where is the Google Colab API?
For anyone coming here from Google trying to find the official Google Colab API (because it's one of the top results when googling for now), here is the answer:
[As of summer 2020] Since this is merely a research project, there is no official API documentation and very limited documentation.
Official Documentation (very limited)
Google Colab: Official FAQ
The Google Colab: Official Feature Demo exemplifies most features. Use it to learn many of its capabilities.
The API in code
Beyond those resources, your best bet would be going to the Official Github Repository. Here are some highlights from the code:
Github: google.colab
Github: google.colab.drive
Github: google.colab.drive.mount (used in quite a few snippets)
Github: google.colab.files (provides download and upload utilities)
Github: google.colab.snippets (add snippets to the snippets list programmatically; FYI: you can find all snippets by going to Insert -> Snippets)
Github: all packages
More Notes
The FAQ explains many important mechanics. Highlights include:
It’s a Jupyter notebook environment that requires no setup to use.
Convinient!
I heartly recommend checking out the Official Feature Demo; it's how I found out that it even supports LaTeX and MathJax! (but then again that might not come as news to someone with experience in Jupyter) 😄
Virtual Machine
The FAQ also mentions...
Code is executed in a virtual machine dedicated to your account. Virtual machines are recycled when idle for a while, and have a maximum lifetime enforced by the system.
That is why you can execute all kinds of the usual system calls (e.g. !pip install, open etc.) and it just works.
However that is also why when you come back the next day...
drive.mount asks for your permission again
you have to re-install all packages
any newly created files are all gone (unless you put em in a drive-mounted folder)
Google Colab Notebooks are just like a normal file in Google Drive.
So, you can use Drive API to manage them just like any Drive files.
For example, you can share notebooks with Drive REST API as documented here
https://developers.google.com/drive/api/v3/manage-sharing

File name conversion for cloud storages?

Lets say I have a web URL to a file on a cloud storage (like Dropbox, Google Drive, etc). How do I convert that to the corresponding file path on my pc? On Android? On iOS?
Assuming of course I have the utilities/apps installed locally.
EDIT: I interested in file name the reverse direction too. (I.e. when I have the local file path, what is the web path?)
EDIT 2: #Greg just made me realize that the problem with file name is much worse on Google Drive than on Dropbox.
And that is very bad. :-(
The reason? Google has good search capabilities on Drive and therefor I and many, many others have put their documents on Drive. However, once I found it I must locate it on my on computer/device. (If I want to edit a pdf for example.)
EDIT 3: #Dan McGrath kindly asked what parts remain unsolved.
Short answer: All. ;-)
Long answer: My actual use case, see below.
My actual use case is a Zotero web app. Zotero is a reference database where you store references to scientific articles, web pages, etc. The items stored in Zotero may include PDF files or - which I prefer - links to PDF files.
I just want to be able to easy access (read) this PDF files from any computer through the web app. And on my own computer I want to be able to edit the files with my local PDF editor. (Be it Android, Windows or whatever.)
By using a cloud storage I do not have to download/upload the files myself. The cloud storage takes care of that part.
For the "reverse" scenario, that is, you have a file and you want the Dropbox shared link, you can use this API endpoint, assuming you're connected to the account via the API:
https://www.dropbox.com/developers/core/docs#shares

HTML5 filesystem - save file on disk

I wonder how I could save a file on disk in a specific folder. Currently, I use HTML5 filesystem API to save and store my information inside the browser. But I'd like to save them on disk and in the same directory as the file that I edit. And without the prompt window.
Thank you in advance for your help!
Chrome Apps can do this via the chrome.fileSystem API. There is a huge amount of information on the web about how to use that API, including extensive documentation from Google. A quick web search should get you what you need.
(Chrome Apps have a lot of APIs not available to ordinary web apps.)
This would be considered a security issue. HTML5 only allows filesystems to be accessed from a protected area on your local drive controlled by the browser.
However, there are ways of storing data to this specified area temporarily or permanently.
window.webkitRequestFileSystem(window.TEMPORARY, 1024*1024, yourFile);
window.webkitRequestFileSystem(window.PERSISTENT , 1024*1024, yourFile);

Upload part of the file to Google drive

Is it possible to change a large file using google drive api, by uploading only changed part of the file, instead of entire file? I tried to find information about it in the API docs, but there's only support for continue uploading after connection reset. It seems to be an important feature.
No it's not possible. The Drive SDK treats files as atomic data blobs. It knows nothing about the format of content and hence what constitutes a change.

What are some Online Cloud Storage Services that can download files directly from the cloud?

What are some Cloud storage Services that can download files from web directly.
For ex- I want to download a file -> www.example.com/god.avi
Now what are some cloud storage services that will allow me to directly upload the file to my account.
Google Drive and Dropbox are cloud services but they dont have this facility.
I assume since you're asking this question on Stack Overflow that you're asking this in the context of programming. In that case, Dropbox has the Saver, which lets a user download a file directly to Dropbox. (Dropbox transfers the file from the URL server-side.)
You can download/upload files pragmatically to Dropbox and also to Google Drive. They have API to do it.
However, if you are really looking for really complete service where you can scale up your data storage until you want, you really want to take a look at Amazon S3. In fact, as far as I know, Dropbox works on the top of Amazon S3 to provide their services.
If you would like to have an idea about how to upload/download a file to Amazon S3, you can take a look to this application example. If you want the same thing on Dropbox or Google Drive, there are a lot of examples on Internet. However, on these two providers you need a token to upload files, what I don't like. I prefer the way in which it works for Amazon S3 (just for programming purposes - GUI is better on GD or Dropbox).