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.
The first steps are the same for both Docker and non-Docker installations.
git clone https://github.com/miguelvalente/clip_classifier.git
cd clip_classifier
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.
The instaling process is quite simple. You only need to have Docker and Docker Compose.
docker-compose run web python3 manage.py migrate
docker-compose run api python3 manage.py migrate
docker-compose run web python3 manage.py migrate
docker-compose up --build
-
Go to http://localhost:3000/ to view the application.
-
Go to http://127.0.0.1:8000/swagger/ to see the full API
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
poetry shell
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.
From the backend directory run:
python manage.py runserver
From the frontend directory run:
npm run dev
-
Go to http://localhost:3000/ to view the application.
-
Go to http://127.0.0.1:8000/swagger/ to see the full API