Invert color channels in anime image

This commit is contained in:
Marcin Kostrzewski 2023-02-01 18:08:55 +01:00
parent 30d8247273
commit ca9163d134

View File

@ -55,7 +55,8 @@ def get_top_results(all_metrics: list[dict], metric='correlation', count=1):
def transfer_to_anime(img: np.ndarray): def transfer_to_anime(img: np.ndarray):
algo = Cartoonizer(dataroot='DCT-Net/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).astype(np.uint8) model_out = algo.cartoonize(img).astype(np.uint8)
return cv2.cvtColor(model_out, cv2.COLOR_BGR2RGB)
def validate(test_set, anime_faces_set, metric='correlation'): def validate(test_set, anime_faces_set, metric='correlation'):