al-livefront's picture
Add test script
e8255bd
# Testing
This test is to run a custom model on Hugging Face using a python script to produce an 'image.png' file. The script requires there to be two files in the same local directory: `New hairstyle applied.png` and `mask-inverted.png`. The first file is a selfie with a roughly overlaid hairstyle. The second is a mask that specifies the strength of the inpainting in particular areas in the image. I included some sample files, but you can try different ones as well.
- Via a Terminal, navigate into the directory with `test-hf.py`, then run these commands:
- `python3 -m venv venv` # This creates a "venv" - a special area to install dependencies
- `. venv/bin/activate` # This activates the "venv" so when you install dependencies they go into the venv, instead of installing system-wide.
- `pip install requests` # This installs the "requests" library, that helps with calling remote web services
- `python3 test-hf.py` # This calls the endpoint on huggingface
- You should now have an `image.png` that shows the inpainted hairstyle.