Skip to content

Commit 9e22482

Browse files
authored
support cpu infer for vsr (#725)
1 parent c2a79fe commit 9e22482

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

applications/tools/video-enhance.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,15 @@
109109
default='none',
110110
nargs='+',
111111
help='Process order')
112+
parser.add_argument("--cpu",
113+
dest="cpu",
114+
action="store_true",
115+
help="cpu mode.")
112116

113117
if __name__ == "__main__":
114118
args = parser.parse_args()
119+
if args.cpu:
120+
paddle.set_device('cpu')
115121

116122
orders = args.process_order
117123
temp_video_path = None

docs/en_US/tutorials/video_restore.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ python tools/video-enhance.py --input you_video_path.mp4 --process_order DAIN De
1212
- `--input (str)`: path of the input video.
1313
- `--output (str)`: path of the output video.
1414
- `--process_order`: name and order of called model. For example, if the input is `DAIN DeOldify EDVR`, then `DAINPredictor` `DeOldifyPredictor` `EDVRPredictor` will be called in sequence.
15+
- `--cpu`: use cpu inference, GPU inference is used by default.
1516

1617
#### Results
1718
![](../../imgs/color_sr_peking.gif)

docs/zh_CN/industrial_solution/video_restore_cn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ python tools/video-enhance.py --input you_video_path.mp4 --process_order DAIN De
1616
- `--input (str)`: 输入的视频路径。
1717
- `--output (str)`: 输出的视频路径。
1818
- `--process_order`: 调用的模型名字和顺序,比如输入为 `DAIN DeOldify PPMSVSR`,则会顺序调用 `DAINPredictor` `DeOldifyPredictor` `PPMSVSRPredictor`
19+
- `--cpu`: 开启cpu推理,默认使用GPU推理。
1920

2021
<div align='center'>
2122
<img src='https://user-images.githubusercontent.com/48054808/117925494-e9a70400-b329-11eb-9f38-a48ef946a3a4.gif' width='600'>

0 commit comments

Comments
 (0)