Examples of using celebrity detection model
Before running these examples you need to ensure that you downloaded the latest archive with Giphy pretrained models (resources). It can be done by this script:
It will download the latest archive with all needed components and extract it into resources directory.
cp .env.example .env
and ensure that
APP_DATA_DIRvariable points to the resources directory.
Create a virtual environment to localize dependencies (optional):
pip install --upgrade virtualenv virtualenv -p python3 ../venv activate source ../venv/bin/activate
model_trainpackage by running the following command from the top-level directory:
pip install -e .
Install requirements from examples directory:
pip install -r requirements.txt
Once you've completed the steps above, there are 2 ways to interact with our model: an inference script and flask application.
Script for model inference
With url or local path to
python inference.py --image_path media/image.jpg
or with url or local path to
python inference.py --gif_path media/video.gif
To start the app just run:
Open provided url in your browser and you should see a UI where you can paste links to images and gifs to test the model.