Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
stylegan2-pytorch
Commits
17ea9588
Commit
17ea9588
authored
Nov 07, 2024
by
dongchy920
Browse files
Update README.md, assets/loss.png, train.py files
parent
c23e301f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
README.md
README.md
+16
-7
assets/loss.png
assets/loss.png
+0
-0
train.py
train.py
+1
-1
No files found.
README.md
View file @
17ea9588
...
@@ -73,17 +73,23 @@ pip install -r requirements.txt
...
@@ -73,17 +73,23 @@ pip install -r requirements.txt
```
```
## 数据集
## 数据集
-
unconditional models训练集
[
FFHQ
](
https://drive.google.com/drive/folders/1u2xu7bSrWxrbUxk-dT-UvEJq8IjdmNTP
)
,
-
unconditional models训练集
[
FFHQ
](
https://drive.google.com/drive/folders/1u2xu7bSrWxrbUxk-dT-UvEJq8IjdmNTP
)
,
SCNet快速下载链接
[
FFHQ_SCNet
](
http://113.200.138.88:18080/aidatasets/project-dependency/ffhq_dataset
)
-
用于快速复现的小数据集SCNet快速下载链接
[
images
](
http://113.200.138.88:18080/aidatasets/project-dependency/stylegan2_pytorch
)
-
用于快速复现的小数据集SCNet快速下载链接
[
images
](
http://113.200.138.88:18080/aidatasets/project-dependency/stylegan2_pytorch
)
下载后
解压到当前目录
下载后
将所有的压缩包解压到/data/ffhq目录中
数据目录结构如下:
数据目录结构如下:
```
```
./data/ffhq/images
./data/ffhq/
└── 00000.png
00000
└── 00001.png
└── 00000.png
└── ...
└── 00001.png
└── ...
01000
└── 01000.png
└── 01001.png
└── ...
...
```
```
...
@@ -91,7 +97,7 @@ pip install -r requirements.txt
...
@@ -91,7 +97,7 @@ pip install -r requirements.txt
先将数据处理为lmdb格式:
先将数据处理为lmdb格式:
```
```
python prepare_data.py --out LMDB ./data/ffhq
/images
python prepare_data.py --out LMDB ./data/ffhq
```
```
### 单机单卡
### 单机单卡
...
@@ -103,6 +109,9 @@ HIP_VISIBLE_DEVICES=2 python train.py LMDB --batch 4
...
@@ -103,6 +109,9 @@ HIP_VISIBLE_DEVICES=2 python train.py LMDB --batch 4
```
```
HIP_VISIBLE_DEVICES=2,3 python -m torch.distributed.launch --nproc_per_node=2 --master_port=29500 train.py --batch 4 LMDB
HIP_VISIBLE_DEVICES=2,3 python -m torch.distributed.launch --nproc_per_node=2 --master_port=29500 train.py --batch 4 LMDB
```
```
<div
align=
center
>
<img
src=
"./assets/loss.png"
/>
</div>
## 推理
## 推理
下载权重文件
[
stylegan2-ffhq-config-f.pt
](
https://pan.baidu.com/s/1IOD4DjjjrMZBF_TfL7pGJQ?pwd=1234
)
下载权重文件
[
stylegan2-ffhq-config-f.pt
](
https://pan.baidu.com/s/1IOD4DjjjrMZBF_TfL7pGJQ?pwd=1234
)
...
...
assets/loss.png
0 → 100644
View file @
17ea9588
66.9 KB
train.py
View file @
17ea9588
...
@@ -337,7 +337,7 @@ if __name__ == "__main__":
...
@@ -337,7 +337,7 @@ if __name__ == "__main__":
parser
.
add_argument
(
"path"
,
type
=
str
,
help
=
"path to the lmdb dataset"
)
parser
.
add_argument
(
"path"
,
type
=
str
,
help
=
"path to the lmdb dataset"
)
parser
.
add_argument
(
'--arch'
,
type
=
str
,
default
=
'stylegan2'
,
help
=
'model architectures (stylegan2 | swagan)'
)
parser
.
add_argument
(
'--arch'
,
type
=
str
,
default
=
'stylegan2'
,
help
=
'model architectures (stylegan2 | swagan)'
)
parser
.
add_argument
(
parser
.
add_argument
(
"--iter"
,
type
=
int
,
default
=
80
0000
,
help
=
"total training iterations"
"--iter"
,
type
=
int
,
default
=
80
,
help
=
"total training iterations"
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--batch"
,
type
=
int
,
default
=
16
,
help
=
"batch sizes for each gpus"
"--batch"
,
type
=
int
,
default
=
16
,
help
=
"batch sizes for each gpus"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment