Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
silvering
DeepMosaics
提交
c21505a2
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,发现更多精彩内容 >>
提交
c21505a2
编写于
11月 24, 2019
作者:
H
hypox64
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
del options.py
上级
c9e5f194
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
63 deletion
+0
-63
options.py
options.py
+0
-63
未找到文件。
options.py
已删除
100644 → 0
浏览文件 @
c9e5f194
import
argparse
import
os
class
Options
():
def
__init__
(
self
):
self
.
parser
=
argparse
.
ArgumentParser
(
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
)
self
.
initialized
=
False
def
initialize
(
self
):
#base
self
.
parser
.
add_argument
(
'--use_gpu'
,
action
=
'store_true'
,
help
=
'if input it, use gpu'
)
self
.
parser
.
add_argument
(
'--media_path'
,
type
=
str
,
default
=
'./hands_test.mp4'
,
help
=
'your videos or images path'
)
self
.
parser
.
add_argument
(
'--mode'
,
type
=
str
,
default
=
'auto'
,
help
=
'add or clean mosaic into your media auto | add | clean'
)
self
.
parser
.
add_argument
(
'--model_path'
,
type
=
str
,
default
=
'./pretrained_models/add_hands_128.pth'
,
help
=
'pretrained model path'
)
self
.
parser
.
add_argument
(
'--result_dir'
,
type
=
str
,
default
=
'./result'
,
help
=
'output result will be saved here'
)
self
.
parser
.
add_argument
(
'--tempimage_type'
,
type
=
str
,
default
=
'png'
,
help
=
'type of temp image, png | jpg, png is better but occupy more storage space'
)
#AddMosaic
self
.
parser
.
add_argument
(
'--mosaic_mod'
,
type
=
str
,
default
=
'squa_avg'
,
help
=
'type of mosaic -> squa_avg | squa_random | squa_avg_circle_edge | rect_avg | random'
)
self
.
parser
.
add_argument
(
'--mosaic_size'
,
type
=
int
,
default
=
0
,
help
=
'mosaic size,if 0 auto size'
)
self
.
parser
.
add_argument
(
'--mask_extend'
,
type
=
int
,
default
=
10
,
help
=
'more mosaic area'
)
self
.
parser
.
add_argument
(
'--mask_threshold'
,
type
=
int
,
default
=
64
,
help
=
'threshold of recognize mosaic position 0~255'
)
self
.
parser
.
add_argument
(
'--output_size'
,
type
=
int
,
default
=
0
,
help
=
'size of output file,if 0 -> origin'
)
#CleanMosaic
self
.
parser
.
add_argument
(
'--netG'
,
type
=
str
,
default
=
'auto'
,
help
=
'select model to use for netG(clean mosaic) -> auto | unet_128 | resnet_9blocks | HD'
)
self
.
parser
.
add_argument
(
'--mosaic_position_model_path'
,
type
=
str
,
default
=
'auto'
,
help
=
'name of model use to find mosaic position'
)
self
.
parser
.
add_argument
(
'--no_feather'
,
action
=
'store_true'
,
help
=
'if true, no edge feather and color correction, but run faster'
)
self
.
parser
.
add_argument
(
'--medfilt_num'
,
type
=
int
,
default
=
11
,
help
=
'medfilt window of mosaic movement in the video'
)
self
.
initialized
=
True
def
getparse
(
self
):
if
not
self
.
initialized
:
self
.
initialize
()
self
.
opt
=
self
.
parser
.
parse_args
()
if
self
.
opt
.
mode
==
'auto'
:
if
'add'
in
self
.
opt
.
model_path
:
self
.
opt
.
mode
=
'add'
elif
'clean'
in
self
.
opt
.
model_path
:
self
.
opt
.
mode
=
'clean'
else
:
print
(
'Please input running mode!'
)
if
self
.
opt
.
netG
==
'auto'
and
self
.
opt
.
mode
==
'clean'
:
if
'unet_128'
in
self
.
opt
.
model_path
:
self
.
opt
.
netG
=
'unet_128'
elif
'resnet_9blocks'
in
self
.
opt
.
model_path
:
self
.
opt
.
netG
=
'resnet_9blocks'
elif
'HD'
in
self
.
opt
.
model_path
:
self
.
opt
.
netG
=
'HD'
else
:
print
(
'Type of Generator error!'
)
if
self
.
opt
.
mosaic_position_model_path
==
'auto'
:
_path
=
os
.
path
.
join
(
os
.
path
.
split
(
self
.
opt
.
model_path
)[
0
],
'mosaic_position.pth'
)
self
.
opt
.
mosaic_position_model_path
=
_path
# print(self.opt.mosaic_position_model_path)
return
self
.
opt
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录