Skip to content

Commit 9fabacb

Browse files
authored
[Feature] use mdformat (open-mmlab#888)
* add pre-commit hook * update all mds * fix
1 parent 5192a1e commit 9fabacb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+459
-404
lines changed

.pre-commit-config.yaml

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
repos:
2-
- repo: https://gitlab.com/pycqa/flake8.git
2+
- repo: https://github.com/PyCQA/flake8
33
rev: 3.7.9
44
hooks:
55
- id: flake8
@@ -24,17 +24,20 @@ repos:
2424
args: ["--remove"]
2525
- id: mixed-line-ending
2626
args: ["--fix=lf"]
27-
- repo: https://github.com/markdownlint/markdownlint
28-
rev: v0.11.0
29-
hooks:
30-
- id: markdownlint
31-
args: ["-r", "~MD002,~MD013,~MD029,~MD033,~MD034",
32-
"-t", "allow_different_nesting"]
3327
- repo: https://github.com/codespell-project/codespell
3428
rev: v2.1.0
3529
hooks:
3630
- id: codespell
37-
args: ["--skip", "*.ipynb,tools/data/hvu/label_map.json,configs/restorers/srresnet_srgan/*.md", "-L", "formating,te,nd,thre,Gool,gool"]
31+
args: ["--skip", "*.ipynb", "-L", "formating,theis"]
32+
- repo: https://github.com/executablebooks/mdformat
33+
rev: 0.7.14
34+
hooks:
35+
- id: mdformat
36+
args: ["--number"]
37+
additional_dependencies:
38+
- mdformat-gfm
39+
- mdformat_frontmatter
40+
- linkify-it-py
3841
- repo: local
3942
hooks:
4043
- id: update-model-index

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ https://user-images.githubusercontent.com/12756472/158972852-be5849aa-846b-41a8-
5555

5656
https://user-images.githubusercontent.com/12756472/158972813-d8d0f19c-f49c-4618-9967-52652726ef19.mp4
5757

58-
5958
### Major features
6059

6160
- **Modular design**
@@ -76,13 +75,13 @@ hope MMEditing could provide better experience.
7675

7776
## News
7877

79-
- [2022-04-01] v0.14.0 was released.
78+
- \[2022-04-01\] v0.14.0 was released.
8079
- Support TOFlow in video frame interpolation
81-
- [2022-03-01] v0.13.0 was released.
80+
- \[2022-03-01\] v0.13.0 was released.
8281
- Support CAIN
8382
- Support EDVR-L
8483
- Support running in Windows
85-
- [2022-02-11] Switch to **PyTorch 1.5+**. The compatibility to earlier versions of PyTorch will no longer be guaranteed.
84+
- \[2022-02-11\] Switch to **PyTorch 1.5+**. The compatibility to earlier versions of PyTorch will no longer be guaranteed.
8685

8786
Please refer to [changelog.md](docs/en/changelog.md) for details and release history.
8887

README_zh-CN.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ https://user-images.githubusercontent.com/12756472/158972852-be5849aa-846b-41a8-
5555

5656
https://user-images.githubusercontent.com/12756472/158972813-d8d0f19c-f49c-4618-9967-52652726ef19.mp4
5757

58-
5958
### 主要特性
6059

6160
- **模块化设计**
@@ -75,13 +74,13 @@ MMEditing 缜密地设计新的框架并将其精心实现,希望能够为您
7574

7675
## 最新消息
7776

78-
- [2022-04-01] v0.14.0 版本发布
77+
- \[2022-04-01\] v0.14.0 版本发布
7978
- 支持视频插帧算法 TOFlow
80-
- [2022-03-01] v0.13.0 版本发布
79+
- \[2022-03-01\] v0.13.0 版本发布
8180
- 支持 CAIN
8281
- 支持 EDVR-L
8382
- 支持在 Windows 系统中运行
84-
- [2022-02-11] 切换到 **PyTorch 1.5+**. 将不再保证与早期版本的 PyTorch 的兼容性
83+
- \[2022-02-11\] 切换到 **PyTorch 1.5+**. 将不再保证与早期版本的 PyTorch 的兼容性
8584

8685
请查看 [changelog.md](docs/en/changelog.md) 以获取更多细节与发版记录
8786

configs/inpainting/deepfillv1/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
Recent deep learning based approaches have shown promising results for the challenging task of inpainting large missing regions in an image. These methods can generate visually plausible image structures and textures, but often create distorted structures or blurry textures inconsistent with surrounding areas. This is mainly due to ineffectiveness of convolutional neural networks in explicitly borrowing or copying information from distant spatial locations. On the other hand, traditional texture and patch synthesis approaches are particularly suitable when it needs to borrow textures from the surrounding regions. Motivated by these observations, we propose a new deep generative model-based approach which can not only synthesize novel image structures but also explicitly utilize surrounding image features as references during network training to make better predictions. The model is a feed-forward, fully convolutional neural network which can process images with multiple holes at arbitrary locations and with variable sizes during the test time. Experiments on multiple datasets including faces (CelebA, CelebA-HQ), textures (DTD) and natural images (ImageNet, Places2) demonstrate that our proposed approach generates higher-quality inpainting results than existing ones.
1212

1313
<!-- [IMAGE] -->
14+
1415
<div align=center >
1516
<img src="https://user-images.githubusercontent.com/12726765/144174665-9675931f-e448-4475-a659-99b65e7d4a64.png" width="400"/>
1617
</div >
@@ -19,17 +20,16 @@ Recent deep learning based approaches have shown promising results for the chall
1920

2021
**Places365-Challenge**
2122

22-
| Method | Mask Type | Resolution | Train Iters | Test Set | l1 error | PSNR | SSIM | Download |
23-
| :--------------------------------------------------------------------------: | :---------: | :--------: | :---------: | :-----------: | :------: | :----: | :---: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
23+
| Method | Mask Type | Resolution | Train Iters | Test Set | l1 error | PSNR | SSIM | Download |
24+
| :---------------------------------------------------------------------------: | :---------: | :--------: | :---------: | :-----------: | :------: | :----: | :---: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
2425
| [DeepFillv1](/configs/inpainting/deepfillv1/deepfillv1_256x256_8x2_places.py) | square bbox | 256x256 | 3500k | Places365-val | 11.019 | 23.429 | 0.862 | [model](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_8x2_places_20200619-c00a0e21.pth) \| [log](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_8x2_places_20200619-c00a0e21.log.json) |
2526

2627
**CelebA-HQ**
2728

28-
| Method | Mask Type | Resolution | Train Iters | Test Set | l1 error | PSNR | SSIM | Download |
29-
| :--------------------------------------------------------------------------: | :---------: | :--------: | :---------: | :--------: | :------: | :----: | :---: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
29+
| Method | Mask Type | Resolution | Train Iters | Test Set | l1 error | PSNR | SSIM | Download |
30+
| :---------------------------------------------------------------------------: | :---------: | :--------: | :---------: | :--------: | :------: | :----: | :---: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
3031
| [DeepFillv1](/configs/inpainting/deepfillv1/deepfillv1_256x256_4x4_celeba.py) | square bbox | 256x256 | 1500k | CelebA-val | 6.677 | 26.878 | 0.911 | [model](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_4x4_celeba_20200619-dd51a855.pth) \| [log](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_4x4_celeba_20200619-dd51a855.log.json) |
3132

32-
3333
## Citation
3434

3535
```bibtex

configs/inpainting/deepfillv1/README_zh-CN.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121

2222
**Places365-Challenge**
2323

24-
| 算法 | 掩膜类型 | 分辨率 | 训练集容量 | 测试集 | l1 损失 | PSNR | SSIM | 下载 |
25-
| :--------------------------------------------------------------------------: | :---------: | :--------: | :---------: | :-----------: | :------: | :----: | :---: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
26-
| [DeepFillv1](/configs/inpainting/deepfillv1/deepfillv1_256x256_8x2_places.py) | square bbox | 256x256 | 3500k | Places365-val | 11.019 | 23.429 | 0.862 | [模型](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_8x2_places_20200619-c00a0e21.pth) \| [日志](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_8x2_places_20200619-c00a0e21.log.json) |
24+
| 算法 | 掩膜类型 | 分辨率 | 训练集容量 | 测试集 | l1 损失 | PSNR | SSIM | 下载 |
25+
| :---------------------------------------------------------------------------: | :---------: | :-----: | :---: | :-----------: | :----: | :----: | :---: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
26+
| [DeepFillv1](/configs/inpainting/deepfillv1/deepfillv1_256x256_8x2_places.py) | square bbox | 256x256 | 3500k | Places365-val | 11.019 | 23.429 | 0.862 | [模型](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_8x2_places_20200619-c00a0e21.pth) \| [日志](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_8x2_places_20200619-c00a0e21.log.json) |
2727

2828
**CelebA-HQ**
2929

30-
| 算法 | 掩膜类型 | 分辨率 | 训练集容量 | 测试集 | l1 损失 | PSNR | SSIM | 下载 |
31-
| :--------------------------------------------------------------------------: | :---------: | :--------: | :---------: | :--------: | :------: | :----: | :---: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
32-
| [DeepFillv1](/configs/inpainting/deepfillv1/deepfillv1_256x256_4x4_celeba.py) | square bbox | 256x256 | 1500k | CelebA-val | 6.677 | 26.878 | 0.911 | [模型](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_4x4_celeba_20200619-dd51a855.pth) \| [日志](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_4x4_celeba_20200619-dd51a855.log.json) |
30+
| 算法 | 掩膜类型 | 分辨率 | 训练集容量 | 测试集 | l1 损失 | PSNR | SSIM | 下载 |
31+
| :---------------------------------------------------------------------------: | :---------: | :-----: | :---: | :--------: | :---: | :----: | :---: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
32+
| [DeepFillv1](/configs/inpainting/deepfillv1/deepfillv1_256x256_4x4_celeba.py) | square bbox | 256x256 | 1500k | CelebA-val | 6.677 | 26.878 | 0.911 | [模型](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_4x4_celeba_20200619-dd51a855.pth) \| [日志](https://download.openmmlab.com/mmediting/inpainting/deepfillv1/deepfillv1_256x256_4x4_celeba_20200619-dd51a855.log.json) |

configs/inpainting/deepfillv2/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
We present a generative image inpainting system to complete images with free-form mask and guidance. The system is based on gated convolutions learned from millions of images without additional labelling efforts. The proposed gated convolution solves the issue of vanilla convolution that treats all input pixels as valid ones, generalizes partial convolution by providing a learnable dynamic feature selection mechanism for each channel at each spatial location across all layers. Moreover, as free-form masks may appear anywhere in images with any shape, global and local GANs designed for a single rectangular mask are not applicable. Thus, we also present a patch-based GAN loss, named SN-PatchGAN, by applying spectral-normalized discriminator on dense image patches. SN-PatchGAN is simple in formulation, fast and stable in training. Results on automatic image inpainting and user-guided extension demonstrate that our system generates higher-quality and more flexible results than previous methods. Our system helps user quickly remove distracting objects, modify image layouts, clear watermarks and edit faces.
1212

1313
<!-- [IMAGE] -->
14+
1415
<div align=center >
1516
<img src="https://user-images.githubusercontent.com/12726765/144175160-75473789-924f-490b-ab25-4c4f252fa55f.png" width="400"/>
1617
</div >
@@ -19,17 +20,16 @@ We present a generative image inpainting system to complete images with free-for
1920

2021
**Places365-Challenge**
2122

22-
| Method | Mask Type | Resolution | Train Iters | Test Set | l1 error | PSNR | SSIM | Download |
23-
| :--------------------------------------------------------------------------: | :-------: | :--------: | :---------: | :-----------: | :------: | :----: | :---: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
23+
| Method | Mask Type | Resolution | Train Iters | Test Set | l1 error | PSNR | SSIM | Download |
24+
| :---------------------------------------------------------------------------: | :-------: | :--------: | :---------: | :-----------: | :------: | :----: | :---: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
2425
| [DeepFillv2](/configs/inpainting/deepfillv2/deepfillv2_256x256_8x2_places.py) | free-form | 256x256 | 100k | Places365-val | 8.635 | 22.398 | 0.815 | [model](https://download.openmmlab.com/mmediting/inpainting/deepfillv2/deepfillv2_256x256_8x2_places_20200619-10d15793.pth) \| [log](https://download.openmmlab.com/mmediting/inpainting/deepfillv2/deepfillv2_256x256_8x2_places_20200619-10d15793.log.json) |
2526

2627
**CelebA-HQ**
2728

28-
| Method | Mask Type | Resolution | Train Iters | Test Set | l1 error | PSNR | SSIM | Download |
29-
| :--------------------------------------------------------------------------: | :-------: | :--------: | :---------: | :--------: | :------: | :----: | :---: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
29+
| Method | Mask Type | Resolution | Train Iters | Test Set | l1 error | PSNR | SSIM | Download |
30+
| :---------------------------------------------------------------------------: | :-------: | :--------: | :---------: | :--------: | :------: | :----: | :---: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
3031
| [DeepFillv2](/configs/inpainting/deepfillv2/deepfillv2_256x256_8x2_celeba.py) | free-form | 256x256 | 20k | CelebA-val | 5.411 | 25.721 | 0.871 | [model](https://download.openmmlab.com/mmediting/inpainting/deepfillv2/deepfillv2_256x256_8x2_celeba_20200619-c96e5f12.pth) \| [log](https://download.openmmlab.com/mmediting/inpainting/deepfillv2/deepfillv2_256x256_8x2_celeba_20200619-c96e5f12.log.json) |
3132

32-
3333
## Citation
3434

3535
```bibtex

0 commit comments

Comments
 (0)