Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Upload resizing #35

Closed
appatalks opened this issue Jun 21, 2023 · 2 comments
Closed

Image Upload resizing #35

appatalks opened this issue Jun 21, 2023 · 2 comments

Comments

@appatalks
Copy link
Owner

appatalks commented Jun 21, 2023

FIXED: Need to work on Mobile part!!

Image Uploads to Vision AI for processing. On non-mobile drag and drop. On mobile there is an Upload button.

Vision AI doesn't need much, maybe I can resize an image payload before sending.

Note that the Vision API imposes a 10MB JSON request size limit;

So maybe not an issue unless metered connection. I'll sleep on this for a bit while I study best path forward.

@appatalks
Copy link
Owner Author

https://cloud.google.com/vision/docs/supported-files

To enable accurate image detection within the Vision API, images should generally be a minimum of 640 x 480 pixels (about 300k pixels). Full details for different types of Vision API Feature requests are shown below:


Note: Vision API requires images to be a sufficient size so that important features within the request can be easily distinguished. Sizes smaller or larger than these recommended sizes may work. However, smaller sizes may result in lower accuracy, while larger sizes may increase processing time and bandwidth usage without providing comparable benefits in accuracy. Image size should not exceed 75M pixels (length x width) for OCR analysis. If the image size exceeds 75M pixels (length x width) , the Vision API resizes the image; otherwise, the Vision API uses the original image.

File size
Image files sent to the Vision API should not exceed 20MB. Files exceeding 20MB generate an error. The Vision API does not resize files of this size. Reducing your file size can significantly improve throughput; however, be careful not to reduce image quality in the process. Note that the Vision API imposes a 10MB JSON request size limit; larger files should be hosted on Cloud Storage or on the web, rather than being passed as base64-encoded content in the JSON itself.

Vision API FeatureRecommended Size *Notes
FACE_DETECTION1600 x 1200Distance between eyes is most important
LANDMARK_DETECTION640 x 480
LOGO_DETECTION640 x 480
LABEL_DETECTION640 x 480
TEXT_DETECTION and DOCUMENT_TEXT_DETECTION1024 x 768OCR requires more resolution to detect characters
SAFE_SEARCH_DETECTION640 x 480

@appatalks
Copy link
Owner Author

API limits are pretty generous, not an issue for time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant