From d7dc4060c9d781020ccafcbc7cc67eca03b1530a Mon Sep 17 00:00:00 2001 From: Daniel Walmsley Date: Wed, 27 Dec 2023 14:05:22 -0800 Subject: [PATCH] Cleanup --- README.md | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f5c45a25..788d8c2e 100644 --- a/README.md +++ b/README.md @@ -156,23 +156,37 @@ The resulting animation was saved as `./garlic_out/video.gif`. #### Alternative: Running locally on macOS -If you're running macOS you may have more success running natively than via Docker. +Here's an example of running natively on macOS rather than via Docker. -To do so, follow these steps: +First install dependencies: ```bash - (animated_drawings) AnimatedDrawings % conda activate animated_drawings - (animated_drawings) AnimatedDrawings % cd torchserve - (animated_drawings) torchserve % torchserve --start --ts-config config.local.properties --foreground +# if you already have java installed, skip this step: +brew install java +sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk + +# install packages +pip install -U openmim torch==1.13.0 torchserve mmdet==2.27.0 mmpose==0.29.0 mmtrack numpy==1.23.3 requests==2.31.0 scipy==1.10.0 tqdm==4.64.1 +mim install mmcv-full==1.7.0 + +# download models +cd torchserve +mkdir -p ./model-store +wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_detector.mar -P ./model-store/ +wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_pose_estimator.mar -P ./model-store/ ``` -Then run the same example we used above with the Docker version: +Now in a new shell activate the animated_drawings env and run ```bash - (animated_drawings) AnimatedDrawings % conda activate animated_drawings - (animated_drawings) AnimatedDrawings % cd examples - (animated_drawings) examples % python image_to_animation.py drawings/garlic.png garlic_out - Writing video to: /Users/you/AnimatedDrawings/examples/garlic_out/video.gif +torchserve --start --ts-config config.local.properties --foreground +``` + +Now you can `cd examples` and run the examples as described above: + +```bash +cd examples +python image_to_animation.py drawings/garlic.png garlic_out ``` ### Fixing bad predictions