From 8e4c805163883a230c5af8d7ed26684f2a033fee Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Sun, 29 Jan 2023 21:23:11 +0100 Subject: [PATCH] Add missing stuff --- main.py | 11 +++++------ requirements.txt | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 242faab..5ed1aa7 100644 --- a/main.py +++ b/main.py @@ -1,16 +1,15 @@ -# Allows imports from the style transfer submodule import sys -sys.path.append('DCT-Net') - import cv2 -import os import numpy as np +# Allows imports from the style transfer submodule +sys.path.append('DCT-Net') + from source.cartoonize import Cartoonizer def load_source(filename: str) -> np.ndarray: - return cv2.imread(filename)[...,::-1] + return cv2.imread(filename)[..., ::-1] def find_and_crop_face(data: np.ndarray) -> np.ndarray: @@ -29,7 +28,7 @@ def compare_with_anime_characters(data: np.ndarray) -> int: def transfer_to_anime(img: np.ndarray): - algo = Cartoonizer(dataroot='damo/cv_unet_person-image-cartoon_compound-models') + algo = Cartoonizer(dataroot='DCT-Net/damo/cv_unet_person-image-cartoon_compound-models') return algo.cartoonize(img) diff --git a/requirements.txt b/requirements.txt index fa339ad..18de5f3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ modelscope==1.1.3 requests==2.28.2 beautifulsoup4==4.11.1 lxml==4.9.2 -opencv-python==4.7.0.68 \ No newline at end of file +opencv-python==4.7.0.68 +torch==1.13.1 \ No newline at end of file