Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
linkedin_61247605
DeepMosaics
提交
480fea7b
DeepMosaics
项目概览
linkedin_61247605
/
DeepMosaics
与 Fork 源项目一致
Fork自
Hypo / DeepMosaics
通知
2
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,发现更多精彩内容 >>
提交
480fea7b
编写于
8月 30, 2020
作者:
H
HypoX64
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix training part #5
上级
9cb4eb05
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
8 deletion
+19
-8
cores/options.py
cores/options.py
+6
-5
deepmosaic.py
deepmosaic.py
+1
-1
make_datasets/make_pix2pix_dataset.py
make_datasets/make_pix2pix_dataset.py
+7
-1
train/add/train.py
train/add/train.py
+2
-0
train/clean/train.py
train/clean/train.py
+2
-0
util/image_processing.py
util/image_processing.py
+1
-1
未找到文件。
cores/options.py
浏览文件 @
480fea7b
...
...
@@ -50,7 +50,7 @@ class Options():
self
.
initialized
=
True
def
getparse
(
self
):
def
getparse
(
self
,
test_flag
=
False
):
if
not
self
.
initialized
:
self
.
initialize
()
self
.
opt
=
self
.
parser
.
parse_args
()
...
...
@@ -65,10 +65,11 @@ class Options():
else
:
self
.
opt
.
use_gpu
=
-
1
if
not
os
.
path
.
exists
(
self
.
opt
.
media_path
):
print
(
'Error: Bad media path!'
)
input
(
'Please press any key to exit.
\n
'
)
exit
(
0
)
if
test_flag
:
if
not
os
.
path
.
exists
(
self
.
opt
.
media_path
):
print
(
'Error: Bad media path!'
)
input
(
'Please press any key to exit.
\n
'
)
exit
(
0
)
if
self
.
opt
.
mode
==
'auto'
:
if
'clean'
in
model_name
or
self
.
opt
.
traditional
:
...
...
deepmosaic.py
浏览文件 @
480fea7b
...
...
@@ -5,7 +5,7 @@ from cores import Options,core
from
util
import
util
from
models
import
loadmodel
opt
=
Options
().
getparse
()
opt
=
Options
().
getparse
(
test_flag
=
True
)
util
.
file_init
(
opt
)
def
main
():
...
...
make_datasets/make_pix2pix_dataset.py
浏览文件 @
480fea7b
...
...
@@ -106,7 +106,13 @@ for fold in range(opt.fold):
# t.start()
saveflag
=
True
x
,
y
,
size
,
area
=
impro
.
boundingSquare
(
mask
,
random
.
uniform
(
1.4
,
1.6
))
if
opt
.
mod
==
[
'drawn'
,
'irregular'
]:
x
,
y
,
size
,
area
=
impro
.
boundingSquare
(
mask_drawn
,
random
.
uniform
(
1.2
,
1.6
))
elif
opt
.
mod
==
[
'network'
,
'irregular'
]:
x
,
y
,
size
,
area
=
impro
.
boundingSquare
(
mask_net
,
random
.
uniform
(
1.2
,
1.6
))
else
:
x
,
y
,
size
,
area
=
impro
.
boundingSquare
(
mask
,
random
.
uniform
(
1.2
,
1.6
))
if
area
<
1000
:
saveflag
=
False
else
:
...
...
train/add/train.py
浏览文件 @
480fea7b
...
...
@@ -10,6 +10,8 @@ import datetime
import
time
import
numpy
as
np
import
matplotlib
matplotlib
.
use
(
'Agg'
)
from
matplotlib
import
pyplot
as
plt
import
cv2
...
...
train/clean/train.py
浏览文件 @
480fea7b
...
...
@@ -16,6 +16,8 @@ from multiprocessing import Process, Queue
from
util
import
mosaic
,
util
,
ffmpeg
,
filt
,
data
from
util
import
image_processing
as
impro
from
models
import
pix2pix_model
,
pix2pixHD_model
,
video_model
,
unet_model
,
loadmodel
,
videoHD_model
import
matplotlib
matplotlib
.
use
(
'Agg'
)
from
matplotlib
import
pyplot
as
plt
import
torch.backends.cudnn
as
cudnn
...
...
util/image_processing.py
浏览文件 @
480fea7b
...
...
@@ -79,7 +79,7 @@ def ch_one2three(img):
res
=
cv2
.
merge
([
img
,
img
,
img
])
return
res
def
color_adjust
(
img
,
alpha
=
1
,
beta
=
0
,
b
=
0
,
g
=
0
,
r
=
0
,
ran
=
False
):
def
color_adjust
(
img
,
alpha
=
0
,
beta
=
0
,
b
=
0
,
g
=
0
,
r
=
0
,
ran
=
False
):
'''
g(x) = (1+α)g(x)+255*β,
g(x) = g(x[:+b*255,:+g*255,:+r*255])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录