Git Product home page Git Product logo

syconet-adaptive-image-harmonization's Introduction

hot Our lab has released the image composition toolbox libcom, which integrates all the functions related to image composition. The toolbox would be continuously upgraded. Welcome to visit and try :-)


SycoNet: Domain Adaptive Image Harmonization

This is the official repository for the following paper:

Deep Image Harmonization with Learnable Augmentation [arXiv]

Li Niu, Junyan Cao, Wenyan Cong, Liqing Zhang
Accepted by ICCV 2023.

SycoNet can generate multiple plausible synthetic composite images based on a real image and a foreground mask, which is useful to construct pairs of synthetic composite images and real images for harmonization. We release the SycoNet inference code and model. The released model is first trained on iHarmony4 and then finetuned on ccHarmony, because ccHarmony can reflect the illumination variation more faithfully.

The released model could be used to generate high-quality synthetic composite images for real images to augment the small-scale training set.

SycoNet

Setup

Clone the repository:

git clone [email protected]:bcmi/SycoNet-Adaptive-Image-Harmonization.git

Install Anaconda and create a virtual environment:

conda create -n syconet python=3.6
conda activate syconet

Install PyTorch:

conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge

Install necessary packages:

pip install -r requirements.txt

Build Trilinear:

cd trilinear_cpp
sh setup.sh

Modify CUDA_HOME as your own path in setup.sh. You can refer to this repository for more solutions.

Inference

Download SycoNet model pretrained_net_Er.pth and 3D LUTs pretrained_net_LUTs.pth from Baidu Cloud (access code:o4rt) or GoogleDrive. Put them in the folder checkpoints\syco.

Test on a single image

Modify real and mask in demo_test.sh as your own real image path and foreground mask path respectively. Modify augment_num as your expected number of generated composite images per pair of real image and foreground mask. Then, run the following command:

sh demo_test_single.sh

Our SycoNet could generate composite images for the input real image and foreground mask in the folder results\syco\test_pretrained.

Test on iHarmony4 dataset

Download iHarmony4 and modify dataset_root, dataset_name in demo_test_iHarmony4.sh as your own dataset path. Then, run the following command:

sh demo_test_iHarmony4.sh

Our SycoNet could generate composite images for the input real images and foreground masks in the specified dataset in the folder results\syco\test_pretrained.

Other Resources

syconet-adaptive-image-harmonization's People

Contributors

ustcnewly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

syconet-adaptive-image-harmonization's Issues

trilinear does not compile with new torch

trilinear cpp extension is not compiled with newer pytorch versions, as dependant on the THC.h which was obsoleted from torch.
that's a known issue and torch guys recommend to migrate from THC to ATen

训练好的图像和谐模型

作者您好
请问咱这边有开源基于Syconet训练好的iS2AM模型吗?我在此项目中没有找到,如果已经开源的话,可以发个链接或者告诉我怎么用吗?
期待您的回复,不胜感激。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.