# COPAINT TLDR: From generated Image -> Copaint PDF [![demo](data/demo.jpg)](data/demo.jpg) ``` 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 https://huggingface.co/spaces/groueix/copaint git push hf main