A ResNet-based image classifier for """specific""" images
Go to file
2024-09-04 15:57:32 -05:00
data updated framework to use the saner framework that mrq/vall-e uses these days 2024-09-04 15:48:29 -05:00
image_classifier oops 2024-09-04 15:57:32 -05:00
scripts updated framework to use the saner framework that mrq/vall-e uses these days 2024-09-04 15:48:29 -05:00
.gitignore updated framework to use the saner framework that mrq/vall-e uses these days 2024-09-04 15:48:29 -05:00
LICENSE updated framework to use the saner framework that mrq/vall-e uses these days 2024-09-04 15:48:29 -05:00
README.md updated framework to use the saner framework that mrq/vall-e uses these days 2024-09-04 15:48:29 -05:00
setup.py updated framework to use the saner framework that mrq/vall-e uses these days 2024-09-04 15:48:29 -05:00

Tentative Title For A ResNet-Based Image Classifier

This is a simple ResNet based image classifier for images, using a similar training framework I use to train VALL-E.

Premise

This was cobbled together in a night, partly to test how well my training framework fares when not married to my VALL-E implementation, and partly to solve a minor problem I faced.

This is by no ways state of the art, as it just leverages an existing ResNet arch provided by torchvision.

Training

  1. Throw the images you want to train under ./data/images/.

  2. Modify the ./data/config.yaml accordingly.

  3. Install using pip3 install -e ./image_classifier/.

  4. Train using python3 -m image_classifier.train --yaml='./data/config.yaml'.

  5. Wait.

Inferencing

Simply invoke the inferencer with the following command: python3 -m image_classifier --path="./data/path-to-your-image.png" --yaml="./data/config.yaml"

Continuous Usage

If you're looking to continuously classify images, use python3 -m image_classifier --listen --port=7860 --yaml="./data/config.yaml" instead to enable a light webserver using simple_http_server. Send a GET request to http://127.0.0.1:7860/?b64={base64 encoded image string} and a JSON response will be returned with the classified label.