MCPcopy Index your code
hub / github.com/chenhaoxing/HDNet

github.com/chenhaoxing/HDNet @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
146 symbols 328 edges 22 files 66 documented · 45%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Hierarchical Dynamic Image Harmonization

PWC

PWC

This is the official code of the ACM MM'23 oral paper: Hierarchical Dynamic Image Harmonization.

Hierarchical Dynamic Image Harmonization
Haoxing Chen, Zhangxuan Gu, Yaohui Li, Jun Lan, Changhua Meng, Weiqiang Wang, Huaxiong Li, ACM Multimedia 2023

Preparation

1. Clone this repo:

git clone https://github.com/chenhaoxing/HDNet
cd HDNet

2. Requirements

  • Both Linux and Windows are supported, but Linux is recommended for compatibility reasons.
  • We have tested on PyTorch 1.8.1+cu11.

install the required packages using pip:

pip3 install -r requirement.txt

or conda:

conda create -n rainnet python=3.8
conda activate rainnet
pip install -r requirement.txt

3. Prepare the data

Download iHarmony4 dataset in dataset folder and run data/preprocess_iharmony4.py to resize the images (eg, 512x512, or 256x256) and save the resized images in your local device.

Training and validation

We provide the code in train_evaluate.py, which supports the model training, evaluation and results saving in iHarmony4 dataset.

python train_evaluate.py --dataset_root <DATA_DIR> --save_dir results --batch_size 12 --device cuda 

Results

Citing HDNet

If you use HDNet in your research, please use the following BibTeX entry.

@inproceedings{MM23_HDNet,
      title={Hierarchical Dynamic Image Harmonization},
      author={Chen, Haoxing and Gu, Zhangxuan and Yaohui Li and Lan, Jun and Meng, Changhua and Wang, Weiqiang and Li, Huaxiong},
      booktitle={ACM Multimedia},
      year={2023}
}

Acknowledgement

Many thanks to the nice work of RainNet. Our codes and configs follow RainNet.

Contacts

Please feel free to contact us if you have any problems.

Email: haoxingchen@smail.nju.edu.cn or hx.chen@hotmail.com

Core symbols most depended-on inside this repo

get_act_conv
called by 7
models/networks.py
get_act_dconv
called by 7
models/networks.py
get_norm_layer
called by 5
models/networks.py
calculateMean
called by 4
train_evaluate.py
reshape_weight_to_matrix
called by 3
util/spectral_norm.py
apply
called by 3
util/spectral_norm.py
load_data
called by 2
data/__init__.py
set_input
called by 2
models/base_model.py

Shape

Method 82
Function 42
Class 22

Languages

Python100%

Modules by API surface

models/networks.py22 symbols
models/base_model.py19 symbols
util/spectral_norm.py16 symbols
models/drconv.py12 symbols
data/base_dataset.py12 symbols
util/util.py8 symbols
data/test_dataset.py7 symbols
train_evaluate.py6 symbols
options/base_options.py6 symbols
models/hdnet_model.py6 symbols
data/iharmony4_dataset.py6 symbols
models/normalize.py4 symbols

For agents

$ claude mcp add HDNet \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page