Metadata-Version: 2.2
Name: gamr_backend_api_service
Version: 1.0.4
Summary: An example Python package
Home-page: https://github.com/example/example_package
Author: Your Name
Author-email: your.email@example.com
Description-Content-Type: text/markdown
Requires-Dist: fastapi==0.115.0
Requires-Dist: uvicorn==0.34.0
Requires-Dist: numpy==1.26.4
Requires-Dist: gradio-client==1.5.0
Requires-Dist: python-multipart==0.0.18
Requires-Dist: pyjwt==2.10.1
Requires-Dist: firebase-admin==6.6.0
Requires-Dist: pydantic_settings
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: summary

# Image-Recognition-App

This app is an example of a pure MLOps probelm solving. The purpose of the app is to input an image and via a MobileNet predict the objects in it. Originally it consisted on two separate components:
* A standalone Python package with the OpenCV model.
* A server side API developed with FastAPI that consumes de model package, deployed in Vercel
* A dummy client side developed with HTML, CSS and Javascript deployed in GitHub Pages.

However, Vercel supports until 250MB of app size, and the model package, which uses OpenCV and another ML libraries, exceeded that number. Then, another solution had to be found. The model package was transformed into another API developed in Gradio and hosted in the free service Hugging Face. Then, the first API now consumes from this second API. Moreover, the image sending handling had to be changed, consisting in several transformations between lists, JSON strings and byte objects.

The resulting architecture is as follows:
1. A dummy client side developed with HTML, CSS and Javascript deployed in GitHub Pages that calls API_1.
2. An API_1 developed with FastAPI hosted in Vercel that calls API_2.
3. An API_2 that hosts the model, developed with Gradio and hosted in Hugging Face.
4. A Python package with the model, unused and replaced by API_2 because of hardware limitations.

API_1 supports automated CI/CD in GitHub Actions. Building includes installing of dependencies,  testing in Pytest, formatting with black and linter. Deployment includes both GitHub Pages and Vercel.

The model Python package supports automated CI/CD in GitHub Actions. Building inludes installing of dependencies, testing in Pytest, formatting with black and linter and package building with setuptools. Deployment includes publishing to PyPI with Twine.

#### FULL TECHNOLOGIES STACK

[API]
* FastAPI
* Uvicorn
* Gradio

[Machine Learning]
* Numpy
* matplotlib
* Pillow
* OpenCV

[Services]
* GitHub Actions
* Vercel
* Hugging Face
* PyPI

[Testing, formatting and building]
* Pytest
* Flake8
* Black
* Pre-commit
* setuptools
* Twine
