GithubHelp home page GithubHelp logo

atomicoo / enhanceimg Goto Github PK

View Code? Open in Web Editor NEW
127.0 0.0 19.0 20.06 MB

Image-enhancement algorithms: low-light enhancement, image restoration, super-resolution reconstruction. 图像增强算法探索:低光增强、图像修复、超分辨率重建 ……

License: MIT License

Python 100.00%
opencv-python image-enhancment retinex gan cyclegan low-light-enhance super-resolution image-inpainting image-restoration pix2pix

enhanceimg's Introduction

EnhanceIMG

[TOC]

此代码库用于图像增强算法的探索,主要包括:低光增强、图像修复、超分辨率重建 ……

目录结构

.
|--- asserts/
|--- awegan/      # GAN相关算法
     |--- datasets/
     |--- models/         # CycleGAN/Pix2Pix/SelfGAN
     |--- options/
     |--- util/
     |--- __init__.py
     |--- train.py
     |--- ...
|--- colorspace/  # 色彩空间转换
|--- edges/       # 边缘检测算法
|--- filters/     # 各种滤波器
|--- histeq/      # 直方图均衡算法
|--- noises/      # 噪声
|--- priors/      # 自然图像先验信息
     |--- __init__.py
     |--- denoising.py
     |--- inpainting.py
     |--- networks.py     # ResNet/SkipNet/UNet
     |--- restoration.py
     |--- ...
|--- retinex/     # Retinex系列算法
     |--- __init__.py
     |--- enhancer.py
     |--- retinex_net.py  # RetinexNet
     |--- ...
|--- utils/       # 一些方法
|--- .gitignore
|--- demo.py
|--- LICENSE
|--- Madison.png
|--- README.md    # 说明文档
|--- requirements.txt     # 依赖文件

简单示例

添加噪声

噪声(原图|椒盐噪声|高斯噪声)

noises

各种滤波器

滤波器(椒盐噪声|均值滤波|中值滤波)

filters1

滤波器(高斯噪声|高斯滤波|双边滤波|联合双边滤波)

filters2

滤波器(高斯噪声|引导滤波)

filters3

边缘检测

检测算子(灰度图|Laplacian|Sobel|Scharr)

opt-edge-detection-2

检测算子(灰度图|LoG|DoG|Gabor)

opt-edge-detection-3

其他算法(灰度图|结构森林|HED|HED-feats-5)

hn-edge-detection

hed-fs1-fs5

传统增强算法

直方图均衡(原图|HE|AHE|CLAHE)

hist-equal

Gamma 校正(原图|Gamma|Gamma+MSS)

adjust-gamma

Retinex(原图|MSRCR|AMSRCR|MSRCP)

retinex

Retinex 增强(原图|AttnMSR|AttnMSR+MSS)(Mine)

enlighten

自然图像先验

降噪(噪声图|降噪1|降噪2)

prior-denoising

神经网络

RetinexNet(原图|RetinexNet)

retinexnet

生成对抗网络

Pix2Pix

(边缘 <=> 图像)

pix2pix-facades

(低光 <=> 正常)

pix2pix

pix2pix4

CycleGAN

(夏天 <=> 冬天)

summer2winter

(低光 <=> 正常)

cyclegan4

参考资料

TODO

  • AttnMSR 图像增强算法(Mine)
  • RetinexNet 低光增强模型
  • ResNet / SkipNet / UNet
  • Deep Image Prior(自然图像先验信息)
  • Pix2Pix 模型用于图像增强
  • CycleGan 模型用于图像增强
  • SelfGAN 图像增强模型(Mine,完善中)

欢迎交流

  • 微信号:YcZhouZy

  • 企鹅号:793071559

enhanceimg's People

Contributors

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

enhanceimg's Issues

performance issue

hello author,

i have implemented similar fcn vgg like yours. But my fcn32 gives better results than fcn 16 and 8. why is this. Can you please check my code.

import torch
import torch.nn as nn
import torchvision.models as models
from pytorch_model_summary import summary

vgg16 = models.vgg16(pretrained=True)
for param in vgg16.features.parameters():
param.requires_grad = False
#False Total params: 185,771,904 Trainable params: 171,057,216 Non-trainable params: 14,714,688
#true Total params: 185,771,904 Trainable params: 185,771,904 Non-trainable params: 0

class fcn(nn.Module):
def init(self):
super(fcn, self).init()
self.features = vgg16.features
self.classifier = nn.Sequential(
nn.Conv2d(512, 4096, 7),
nn.ReLU(inplace=True),
#nn.Dropout2d(),
nn.Conv2d(4096, 4096, 1),
nn.ReLU(inplace=True),
#nn.Dropout2d(),
nn.Conv2d(4096, 32, 1),
nn.ConvTranspose2d(32, 32, 224, stride=32)
)

def forward(self, x):
x = self.features(x)#/32
x = self.classifier(x)
#print(x.shape)
return x

class fcn16(nn.Module):
def init(self):
super(fcn16, self).init()
self.features = vgg16.features
self.classifier = nn.Sequential(
nn.Conv2d(512, 4096, 7),
nn.ReLU(inplace=True),
nn.Conv2d(4096, 4096, 1),
nn.ReLU(inplace=True),
nn.Conv2d(4096, 32, 1)
)
self.score_pool4 = nn.Conv2d(512, 32, 1)
self.upscore2 = nn.ConvTranspose2d(32, 32, 14, stride=2, bias=False)
self.upscore16 = nn.ConvTranspose2d(32, 32, 16, stride=16, bias=False)

def forward(self, x):
pool4 = self.features:-7#512 features /16
pool5 = self.features-7:#512 features /16/2=/32
pool5_upscored = self.upscore2(self.classifier(pool5))#32 class features stride2 /32*2=/16
pool4_scored = self.score_pool4(pool4)#32 features /16
combined = pool4_scored + pool5_upscored
#combined = torch.cat([pool4_scored, pool5_upscored])
res = self.upscore16(combined)# /1
return res

class fcn8(nn.Module):
def init(self):
super(fcn8, self).init()
self.features = vgg16.features
self.classifier = nn.Sequential(
nn.Conv2d(512, 4096, 7),
nn.ReLU(inplace=True),
nn.Conv2d(4096, 4096, 1),
nn.ReLU(inplace=True),
nn.Conv2d(4096, 32, 1)
)
self.score_pool4 = nn.Conv2d(512, 32, 1)
self.score_pool3 = nn.Conv2d(256, 32, 1)
self.upscore2 = nn.ConvTranspose2d(32, 32, 14, stride=2, bias=False)
self.upscore3 = nn.ConvTranspose2d(32, 32, 2, stride=2, bias=False)
#self.upscore16 = nn.ConvTranspose2d(32, 32, 16, stride=16, bias=False)
self.upscore8 = nn.ConvTranspose2d(32, 32, 8, stride=8, bias=False)

def forward(self, x):
pool3 = self.features:-14#256 features /8
pool4 = self.features-14:-7#512 features /8/2=16
pool5 = self.features-7:#512 features /16/2=/32
pool5_upscored = self.upscore2(self.classifier(pool5))#32 class features stride2 /322=/16
pool4_scored = self.score_pool4(pool4)#32 class features /16
pool3_scored = self.score_pool3(pool3)#32 class features /8
combined = pool4_scored + pool5_upscored #/16
#print(combined.shape)
combined_upscored = self.upscore3(combined)#32 class features stride2 /16
2=/8
#print(combined_upscored.shape)
combined2 = pool3_scored + combined_upscored
#print(combined2.shape)
#res = self.upscore16(combined)#/1
res = self.upscore8(combined2)#/1
#print(res.shape)
return res

gan模型权重

感谢大佬的分享 请问下gan模型那边权重有下载链接吗

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.