Skip to content

This repository contains a implementation of an image classifier API using FastAPI and vision-and-language models

License

Notifications You must be signed in to change notification settings

jvpigozzo/office-items-img-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast API - Office Items Image Classifier

Python FastAPI Docker MongoDB Licence

This project is an API built using Python, FastAPI, MongDB as the database. The API was developed to solve office items image classification and management.

Table of Contents

Installation

1. Clone the repository:

git clone https://github.com/jvpigozzo/office-items-img-classifier.git

Usage

2. Building and running the application with docker:

When you're ready, start your application by running:

docker compose up --build

Your application will be available at http://localhost:80.

API Endpoints

3. The API provides the following endpoints:

GET USERS

GET /users - Retrieve a list of all users.
[
  {
    "name": "João Vitor Pigozzo",
    "email": "[email protected]",
    "nickname": "jvpigozzo",
    "id": "66492f93e509e0279f9dafd0"
  }
]

POST USERS

POST /users - Register a new user into the App
{
    "name": "João Vitor Pigozzo",
    "email": "[email protected]",
    "nickname": "jvpigozzo"
}

GET ITEMS

GET /items - Retrieve a list of all items.
[
  {
    "name": "pen1",
    "label_id": "2",
    "image_url": "/vol/media/img_20231102_132236.jpg",
    "is_validated": false,
    "id": "6648acc879284bb3f952ff98"
  }
]

POST ITEMS

POST /items - Register a new item into the App
{
  "name": "pencil1",
  "label_id": "1",
  "is_validated": true
}

POST ITEMS IMAGE

POST /items/image-upload/{item_id} - Upload image file
  • item_id : The unique identifier of the item.
  • image (form-data): The image file to be uploaded.

POST ITEMS RECOGNIZE

POST /items/recognize/{item_id} - Recognize image with chosen model
{
  "item_id": "6648acc879284bb3f952ff98",
  "prompt_template": "What's in the image?",
  "model_name": "gpt-4-turbo"
}

Database

The project utilizes MongoDB as the database.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request to the repository.

About

This repository contains a implementation of an image classifier API using FastAPI and vision-and-language models

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages