Spaces:
Running
Running
A newer version of the Gradio SDK is available:
5.33.1
COPAINT
TLDR: From generated Image -> Copaint PDF
git clone https://github.com/ThibaultGROUEIX/copaint.git
git lfs pull #(install git LFS)
Usage and Install
# Install dependencies
poetry install --with ui
# Run Gradio App on local server
poetry run copaint-app
Alternative Usage and Install (CLI)
# Install dependencies
pip install torch torchvision reportlab PyPDF2 Pillow argparse gradio_pdf
# Run
python copaint.py --input_image data/bear.jpg --copaint_logo copaint/static/logo_copaint.png --outputfolder output
# Using the CLI
pip install --upgrade pip
pip install -e .
# Case 1 : generate all the presets
copaint --input_image data/bear.jpg --copaint_logo copaint/static/logo_copaint.png --outputfolder output --use_presets True
# Case 2 : provide a number of participants, the program will generate the best grid
copaint --input_image data/bear.jpg --copaint_logo copaint/static/logo_copaint.png --outputfolder output --nparticipants 45
# Case 3 : provide the number of cells in the grid
copaint --input_image data/bear.jpg --copaint_logo copaint/static/logo_copaint.png --outputfolder output --h_cells 3 --w_cells 4
Build and deploy
# Build
poetry build
# Deploy
poetry publish
Time bottleneck
-- the biggest time bottleneck is writing to disk the back image and loading for the PDF creation.
Deploy to huggingface.
git remote add hf_en https://huggingface.co/spaces/groueix/copaint git remote add hf_fr https://huggingface.co/spaces/groueix/copaint_fr
to check remotes : git remote -v
change language in app.py
git push hf_en main git push hf_fr main