Git Product home page Git Product logo

wavect-ain_base_version's Introduction

WaveCT-AIN_base_version

(Style Transfer for Medical Image)

Getting Started

Dependency

  • PyTorch >= 0.4.1
  • Check the requirements.txt
pip install -r requirements.txt

Arguments

  • --content: FOLDER-PATH-TO-CONTENT-IMAGES
  • --style: FOLDER-PATH-TO-STYLE-IMAGES
  • --output: FOLDER-PATH-TO-OUTPUT-IMAGES
  • --image_size: output image size
  • -a: all transfer
  • -d: decoder transfer
  • -e: encoder transfer
  • -s: skip transfer

Introduction

  • Pretrained models can be found in the ./model_checkpoints
  • Content and style images can be found in the./examples
  • ./transfer.py is the transfer code
  • Test the model:
CUDA_VISIBLE_DEVICES=5 python transfer.py --content ./examples/content --style ./examples/style --output ./outputs/ --verbose --image_size 512 -d

The test results will be saved to ./outputs by default.

Result

Please cite:

Liu, Zhendong, et al. "Remove appearance shift for ultrasound image segmentation via fast and universal style transfer." 2020 IEEE 17th International Symposium on Biomedical Imaging (ISBI). IEEE, 2020.

wavect-ain_base_version's People

Contributors

kevinoop0 avatar

Stargazers

gao yue avatar  avatar Wuke peng avatar  avatar Kevin avatar Xinyu Liu avatar  avatar  avatar

Watchers

 avatar

wavect-ain_base_version's Issues

Hello, sir, I have the following problem after running

Namespace(content='./examples/content', image_size=512, option_unpool='cat5', output='./outputs/', style='./examples/style', transfer_all=False, transfer_at_decoder=True, transfer_at_encoder=False, transfer_at_skip=False, verbose=True)
0%| | 0/2 [00:00<?, ?it/s]------ transfer: ./outputs/1.png
transfer at decoder 4
transfer at decoder 3
transfer at decoder 2
transfer at decoder 1
Elapsed time in whole WCT: 0:00:02.243419
50%|███████████████████████████████▌ | 1/2 [00:05<00:05, 5.66s/it]------ transfer: ./outputs/2.png
Elapsed time in whole WCT: 0:00:00.103988
50%|███████████████████████████████▌ | 1/2 [00:05<00:05, 5.77s/it]
Traceback (most recent call last):
File "transfer.py", line 174, in
run_bulk(config)
File "transfer.py", line 137, in run_bulk
img = wct.transfer(content, style)
File "transfer.py", line 68, in transfer
style_feats, style_skips = self.get_all_feature(style)
File "transfer.py", line 54, in get_all_feature
x = self.encode(x, skips, level)
File "transfer.py", line 45, in encode
return self.encoder.encode(x, skips, level)
File "/home/ps/xushaokang/WaveCT-AIN_base_version-main/model.py", line 164, in encode
out = self.conv0(x)
File "/home/ps/xushaokang/registration_env/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ps/xushaokang/registration_env/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/home/ps/xushaokang/registration_env/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,

RuntimeError: Given groups=1, weight of size [3, 3, 1, 1], expected input[1, 1, 512, 512] to have 3 channels, but got 1 channels instead

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.