idkiro / starenhancer Goto Github PK
View Code? Open in Web Editor NEW[ICCV 2021 Oral] StarEnhancer: Learning Real-Time and Style-Aware Image Enhancement
License: MIT License
[ICCV 2021 Oral] StarEnhancer: Learning Real-Time and Style-Aware Image Enhancement
License: MIT License
不做风格迁移而是单纯的iamge retouching
非常感谢您开源代码!
您是否进行过,使用GAN进行非成对训练的实验,这样是否可行,您对此有什么看法吗?
Hi!
If I want to test my images with your pretrained model, where should I put my images?
您好,在多风格非配对图场景,能否交换source和target的位置,并将得到的output_A和output_B进一步经过enhancer,得到recover_A和recover_B。最后计算l1_loss(source, recover_A)和l1_loss(target, recover_B)及Triplet_loss(output_A,target, source) 和 Triplet_loss(output_B,source,target)
def train(train_loader, mapping, enhancer, criterion, optimizer):
losses = AverageMeter()
criterionTriplet = torch.nn.TripletMarginLoss(margin=1.0, p=2)
FEModel = Feature_Extract_Model().cuda()
mapping.train()
enhancer.train()
for (source_img, source_center, target_img, target_center) in train_loader:
source_img = source_img.cuda(non_blocking=True)
source_center = source_center.cuda(non_blocking=True)
target_img = target_img.cuda(non_blocking=True)
target_center = target_center.cuda(non_blocking=True)
style_A = mapping(source_center)
style_B = mapping(target_center)
output_A = enhancer(source_img, style_A, style_B)
output_B = enhancer(target_img, style_B, style_A)
recoverA = enhancer(output_A, style_B, style_A)
recoverB = enhancer(output_B, style_A, style_B)
source_img_feature = FEModel(source_img)
target_img_feature = FEModel(target_img)
output_A_feature = FEModel(output_A)
output_B_feature = FEModel(output_B)
loss_l1 = criterion(recoverA, source_img) + criterion(recoverB, target_img)
loss_triplet = criterionTriplet(output_B_feature, source_img_feature, target_img_feature) + \
criterionTriplet(output_A_feature, target_img_feature, source_img_feature)
loss = loss_l1 + loss_triplet
losses.update(loss.item(), args.t_batch_size)
optimizer.zero_grad()
loss.backward()
optimizer.step()
return losses.avg
I am the author.
Some peers have emailed me asking about the performance of the open source model that does not agree with the results in the paper.
As stated in the README, the model is not the model of the paper, but the performance is similar.
The exact result should be:
PSNR: 25.41, SSIM: 0.942, LPIPS: 0.085
If you find that your result is not this, then it may be that the JPEG codec is different, which is related to the version of opencv and how it is installed.
You can uninstall your opencv (either with pip or conda) and reinstall it using pip (it must be pip, because conda installs a different JPEG codec):
pip install opencv-python==4.5.5.62
提供的pretrain模型可以直接跑出enhancer的效果吗,还是说必须先加载进来训练呢,我发现直接加载pretrain的模型跑出的图片没有什么效果。
请问对于style_encoder部分,我该如何在我的数据集上训练分类,同时,对于proxy这部分的含义我不太清楚,希望您能指点一二!
I am testing your codes on single-style enhancement. However, in line 103-104 of the file 'loader.py', I find you randomly use images of different styles as the source image and target image during the training and validation stage, which may cause the optimization process unstable. It is better to fix the source style and target style?
您好,我想用您的工程跑一下自己的数据,现在有输入,输出一组数据对,训练数据里面A-E剩下的4种效果是怎样生成的呢,这些目标效果数据能否是非成对的呢?如果只有一种风格,能否A-E目标效果都拷贝成一样的数据呢,在train_enhancer.py所训练的单风格脚本是需要embeddings.npy文件,这个文件在单风格训练时是必须的吗
您的工作非常棒!但是我有一个问题,风格编码网络是否可以使用现成的VGG19网络,也许这样更为方便,预训练的VGG网络同样可以提取光照,色彩等信息。
期待您的解答。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.