Skip to content

Latest commit

 

History

History
115 lines (75 loc) · 2.88 KB

README.md

File metadata and controls

115 lines (75 loc) · 2.88 KB

Clip Classifier

This is an image classification app built using Django 3, Django REST Framework 3, Next.js 12, and Material UI 5. The app uses CLIP to classify images selected by the user provided a list.

plot

Installation

The first steps are the same for both Docker and non-Docker installations.

1. Clone the project

git clone https://github.com/miguelvalente/clip_classifier.git
cd clip_classifier

2. Download Clip

wget -P backend/model https://openaipublic.azureedge.net/clip/models/40d365715913c9da98579312b702a82c18be219cc2a73407c4526f58eba950af/ViT-B-32.pt

After that you can either install/run the app with Docker or Without Docker.

With Docker

The instaling process is quite simple. You only need to have Docker and Docker Compose.

3. Migrate

docker-compose run web python3 manage.py migrate

docker-compose run api python3 manage.py migrate

4. Build/Run the app

docker-compose run web python3 manage.py migrate

docker-compose up --build

5. View the application & Acccess the swagger documentation

Without Docker

To install the app without Docker, you will have to install the backend and frontend dependencies, separately as well as start both backend and frontend.

3. Install required backend dependencies with Poetry

cd backend
poetry install

4. Activate the environment python backend environemnt

poetry shell

5. Run migrations

python manage.py makemigrations
python manage.py migrate

6. Install required frontend dependencies. You need Node.js

cd ../frontend
npm install

To run the application, you need to have both the backend and the frontend up and running.

7. Run backend

From the backend directory run:

python manage.py runserver

8. Run frontend

From the frontend directory run:

npm run dev

9. View the application & Acccess the swagger documentation

Acknowledgment

Resources to learn Django and React