StyleCLIP Playground is a project that provides a front-end to the StyleCLIP official implementation.
Due to the time constraint, this project was built within 24 hours. The code may contain vulneraibilities that hackers can expliot. I highly recommend not to deploy the project to a publically accessible server. The project is still under development (after I finish my assignments and taking the finals). If you are interested in the project, considering star to the project ;)
-
Install Anaconda.
-
Create a virtual environemnt (recommended) and activate the environment.
conda create -n styleclip python==3.10 -y
conda activate styleclip
- Install PyTorch
If you have a GPU with CUDA support
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.6 -c pytorch -c conda-forge
If you wish to run it on a machine without NVIDIA graphic card, install the CPU only version.
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 -c pytorch
- Install other dependencies with
pip
.
pip install -r requirements.txt
-
Download the pretrained models and extract according to the folder structure.
-
Populate the database (by default, run with SQLite3).
python populate.py
By default, several users are created. They are admin
, user1
, and user2
. Their passwords are 12345678
.
- Run the front-end (development server).
python run_web.py dev
- Run the service-end.
python run_service.py --device=cpu --app-config=dev
- Access the web with
http://127.0.0.1
. The port number can be changed inconfigurations/dev.json
. Note: This is just for development purposes, do not deploy the application like this. Instead, use a WSGI server.
Part of the code of this project is based on the open-source development framework, Mangee Flask-RESTful. The framework was developed by Bohui WU (@RapDoodle, one of our team members). The complete source code of the framework can be found in https://github.com/RapDoodle/mangee-flask-restful.
The project is licensed under the MIT License.