Coder Social home page Coder Social logo

lesliezhoa / dct-net.pytorch Goto Github PK

View Code? Open in Web Editor NEW
96.0 96.0 6.0 35.45 MB

unofficial implementation of DCT-Net: Domain-Calibrated Translation for Portrait

License: MIT License

Python 85.17% C++ 2.11% Cuda 11.75% Shell 0.98%
dct gan style-transfer

dct-net.pytorch's Introduction

Hi there 👋

I am Leslie from China, nice to meet you all!

  • 😄 Interst: computer vision especially Image generation

  • 📫 How to reach me: send email to [email protected]

Leslie's GitHub stats

Top Langs

dct-net.pytorch's People

Contributors

lesliezhoa 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  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  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  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  avatar  avatar  avatar  avatar

dct-net.pytorch's Issues

Inference does not work correctly

Hi @LeslieZhoa, thanks for your implementation.
I tried running the inference.py script and I faced some problems.

I fixed the 'netG' key in the line:

self.net.load_state_dict(ckpt['netG'],strict=False)

to 'G' because final.pth does not contain 'netG'.

Also in the postprocess method you make the slice [..., ::-1], and you also make it after calling the run method:

oup = model.run(img)[...,::-1]

I removed the extra slice.
But I still get an unrealistic image (ran at 1024 and 256 resolutions). I'm attaching an example (first line is 1024, second line is 256) and waiting for a response/comment.
dct_net

Training error

Hi @LeslieZhoa ! How can you compare the dictionary and the float?

if loss < mn_loss:

This method is called here:

acc_num,mn_loss,stop_flag = self.early_stop_wait(self.get_loss_from_val(val_loss),acc_num,mn_loss,epoch)

But the val_loss obtained in CCNTrainer.evalution is an empty dictionary:

def evalution(self,test_loader,steps,epoch):
loss_dict = {}
with torch.no_grad():
fake_s,_ = self.netGs([self.sample_z])
fake_t,_ = self.gt_ema([self.sample_z])
if self.args.rank == 0 :
self.val_vis.display_current_results(self.select_img([fake_s,fake_t]),steps)
# self.val_vis.display_current_results(self.select_img([fake_t]),steps)
return loss_dict

I want to understand how to fix this and what metrics to count? And as I understand it, you trained the network without early_stopping. How many epochs/iterations did it take?

背景问题

生成人脸都比较好,就是处理整图背景表现出有一块一块的黑色的

训练结果看起来不太正常

哈喽,大佬,我按照你的readme训练了自己的样式,但效果貌似不太令人满意,能告知我大概在哪出了问题吗
训练样式图:(1200张)
image
ccn训练了2000步
ttn训练了4w步的结果是:
image
image

非常好的开源代码

非常感谢作者伟大的工作,我尝试用ttn代码训练(ccn,face expression estimator等都没发现啥问题),大概训练了50epoch,但是效果不太理想。是训练时间过短还是有其他原因。

Training data size

What is the image size used for training CCN,
Why can't the matrix be multiplied when I input 1024 in training,
and The problem of ' 'Nan or Inf found in input tensor '' when inputting 256 during training

关于ccn的blend和eometry expansion module

十分感谢你的贡献,但我有几个问题想要咨询一下。
我发现你在训练ccn的时候没有做论文中提到的blend操作,Geometry expansion module我也没有找到,这是有什么原因吗?
另外论文作者提到他用相同的模型对头部和背景进行了两次推理,只是对头部模型进行了额外的优化,但在你复现中似乎只有一个模型并且只做了一次推理,是有什么改动吗?
另外show中展示的效果似乎不是很好,有更好的效果图可以分享一下吗?谢谢

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.