代码拉取完成,页面将自动刷新
同步操作将从 mirrors_microsoft/Bringing-Old-Photos-Back-to-Life 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
---
- name: Bringing-Old-Photos-Back-to-Life
hosts: all
gather_facts: no
# Succesfully tested on Ubuntu 18.04\20.04 and Debian 10
pre_tasks:
- name: install packages
package:
name:
- python3
- python3-pip
- python3-venv
- git
- unzip
- tar
- lbzip2
- build-essential
- cmake
- ffmpeg
- libsm6
- libxext6
- libgl1-mesa-glx
state: latest
become: yes
tasks:
- name: git clone repo
git:
repo: 'https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life.git'
dest: Bringing-Old-Photos-Back-to-Life
clone: yes
- name: requirements setup
pip:
requirements: "~/Bringing-Old-Photos-Back-to-Life/requirements.txt"
virtualenv: "~/Bringing-Old-Photos-Back-to-Life/.venv"
virtualenv_command: /usr/bin/python3 -m venv .venv
- name: additional pip packages #requirements lack some packs
pip:
name:
- setuptools
- wheel
- scikit-build
virtualenv: "~/Bringing-Old-Photos-Back-to-Life/.venv"
virtualenv_command: /usr/bin/python3 -m venv .venv
- name: git clone batchnorm-pytorch
git:
repo: 'https://github.com/vacancy/Synchronized-BatchNorm-PyTorch'
dest: Synchronized-BatchNorm-PyTorch
clone: yes
- name: copy sync_batchnorm to face_enhancement
copy:
src: Synchronized-BatchNorm-PyTorch/sync_batchnorm
dest: Bringing-Old-Photos-Back-to-Life/Face_Enhancement/models/networks/
remote_src: yes
- name: copy sync_batchnorm to global
copy:
src: Synchronized-BatchNorm-PyTorch/sync_batchnorm
dest: Bringing-Old-Photos-Back-to-Life/Global/detection_models
remote_src: yes
- name: check if shape_predictor_68_face_landmarks.dat
stat:
path: Bringing-Old-Photos-Back-to-Life/Face_Detection/shape_predictor_68_face_landmarks.dat
register: p
- name: get shape_predictor_68_face_landmarks.dat.bz2
get_url:
url: http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
dest: Bringing-Old-Photos-Back-to-Life/Face_Detection/
when: p.stat.exists == False
- name: unarchive shape_predictor_68_face_landmarks.dat.bz2
shell: 'bzip2 -d Bringing-Old-Photos-Back-to-Life/Face_Detection/shape_predictor_68_face_landmarks.dat.bz2'
when: p.stat.exists == False
- name: check if face_enhancement
stat:
path: Bringing-Old-Photos-Back-to-Life/Face_Enhancement/checkpoints/Setting_9_epoch_100/latest_net_G.pth
register: fc
- name: unarchive Face_Enhancement/checkpoints.zip
unarchive:
src: https://facevc.blob.core.windows.net/zhanbo/old_photo/pretrain/Face_Enhancement/checkpoints.zip
dest: Bringing-Old-Photos-Back-to-Life/Face_Enhancement/
remote_src: yes
when: fc.stat.exists == False
- name: check if global
stat:
path: Bringing-Old-Photos-Back-to-Life/Global/checkpoints/detection/FT_Epoch_latest.pt
register: gc
- name: unarchive Global/checkpoints.zip
unarchive:
src: https://facevc.blob.core.windows.net/zhanbo/old_photo/pretrain/Global/checkpoints.zip
dest: Bringing-Old-Photos-Back-to-Life/Global/
remote_src: yes
when: gc.stat.exists == False
# Do not forget to execute 'source .venv/bin/activate' inside Bringing-Old-Photos-Back-to-Life before starting run.py
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。