Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
silvering
DeepMosaics
提交
a3ecbfd9
DeepMosaics
项目概览
silvering
/
DeepMosaics
与 Fork 源项目一致
Fork自
Hypo / DeepMosaics
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DeepMosaics
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a3ecbfd9
编写于
7月 27, 2019
作者:
H
hypox64
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
I'm back
上级
b4d5c316
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
12 deletion
+17
-12
README.md
README.md
+5
-8
models/loadmodel.py
models/loadmodel.py
+3
-2
models/pix2pix_model.py
models/pix2pix_model.py
+3
-0
models/unet_model.py
models/unet_model.py
+3
-1
models/unet_parts.py
models/unet_parts.py
+3
-1
未找到文件。
README.md
浏览文件 @
a3ecbfd9
...
...
@@ -3,16 +3,14 @@
You can use it to automatically remove the mosaics in images and videos, or add mosaics to them.
<br>
This porject based on semantic segmentation and pix2pix.
<br>
## Notes
The code do not include the part of training, I will finish it in my free time.
<br>
## Prerequisites
-
Linux, (I didn't try this code on Windows or
Mac OS
)
-
Python 3.
6
+
-
Linux, (I didn't try this code on Windows or
mac machine
)
-
Python 3.
5
+
-
ffmpeg
-
Pyt
orch 1.0+
[
(Old version codes)
](
https://github.com/HypoX64/DeepMosaics/tree/Pytorch0.4
)
-
Pyt
roch 0.4, (I will update to 1.0
)
-
CPU or NVIDIA GPU + CUDA CuDNN
## Getting Started
...
...
@@ -23,9 +21,8 @@ cd DeepMosaics
```
### Get pre_trained models and test video
You can download pre_trained models and test video and replace the files in the project.
<br>
[
[Google Drive]
](
https://drive.google.com/open?id=10nARsiZoZGcaKw40nQu9fJuRp1oeabPs
)
[
[百度云,提取码7thu]
](
https://pan.baidu.com/s/1IG4bdIiIC9PH9-oEyae5Sg
)
[
[Google Drive]
](
https://drive.google.com/open?id=1PXt3dE9Eez2xUqpemLJutwTCC0tW-D2g
)
[
[百度云,提取码z8vz]
](
https://pan.baidu.com/s/1Wi8T6PE4ExTjrHVQhv3rJA
)
### Dependencies
This code depends on numpy, scipy, opencv-python, torchvision, available via pip install.
### AddMosaic
...
...
models/loadmodel.py
浏览文件 @
a3ecbfd9
...
...
@@ -3,14 +3,15 @@ from .pix2pix_model import *
from
.unet_model
import
UNet
def
pix2pix
(
model_path
,
G_model_type
,
use_gpu
=
True
):
gpu_ids
=
[]
netG
=
define_G
(
3
,
3
,
64
,
G_model_type
,
norm
=
'batch'
,
init_type
=
'normal'
,
gpu_ids
=
gpu_ids
)
netG
=
define_G
(
3
,
3
,
64
,
G_model_type
,
norm
=
'batch'
,
use_dropout
=
True
,
init_type
=
'normal'
,
gpu_ids
=
[]
)
netG
.
load_state_dict
(
torch
.
load
(
model_path
))
netG
.
eval
()
if
use_gpu
:
netG
.
cuda
()
return
netG
def
unet
(
model_path
,
use_gpu
=
True
):
net
=
UNet
(
n_channels
=
3
,
n_classes
=
1
)
net
.
load_state_dict
(
torch
.
load
(
model_path
))
...
...
models/pix2pix_model.py
浏览文件 @
a3ecbfd9
# This code clone from https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix
# LICENSE file : https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/LICENSE
import
torch
import
torch.nn
as
nn
from
torch.nn
import
init
...
...
models/unet_model.py
浏览文件 @
a3ecbfd9
# This code clone from https://github.com/milesial/Pytorch-UNet
# LICENSE file : https://github.com/milesial/Pytorch-UNet/blob/master/LICENSE
# full assembly of the sub-parts to form the complete net
import
torch.nn.functional
as
F
from
.unet_parts
import
*
class
UNet
(
nn
.
Module
):
...
...
models/unet_parts.py
浏览文件 @
a3ecbfd9
# sub-parts of the U-Net model
# This code clone from https://github.com/milesial/Pytorch-UNet
# LICENSE file : https://github.com/milesial/Pytorch-UNet/blob/master/LICENSE
# sub-parts of the U-Net model
import
torch
import
torch.nn
as
nn
import
torch.nn.functional
as
F
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录