許多歷史人才只被舊,褪色,黑白照片捕獲,這些照片由於早期相機的局限性和時間流逝而被扭曲。本文模擬了與現代攝像機的時光倒流,再到重新攝影著名的主題。與傳統的圖像恢復過濾器不同,該過濾器採用獨立操作(例如Denoising,顏色化和超級分辨率),我們利用stylegan2框架將舊照片投射到現代高分辨率照片的空間中,從而在統一的框架中實現了所有這些效果。這種方法的一個獨特挑戰是保留原始照片中對象的身份和姿勢,同時丟棄在低質量古董照片中經常看到的許多文物。我們與當前的最新修復過濾器的比較顯示了各種重要歷史人物的顯著改善和令人信服的結果。
時間旅行重新攝影
Xuan Luo,Xuaner Zhang,Paul Yoo,Ricardo Martin-Brualla,Jason Lawrence和Steven M. Seitz
在2021年亞洲Siggraph。
我們使用Google Colab提供了易於啟動的演示! COLAB將允許您使用Google Colab上的Cloud GPU在樣本Abraham Lincoln照片或您自己的照片上嘗試我們的方法。
或者,您可以按照以下說明在自己的計算機上運行我們的方法。
拉第三方套餐。
git submodule update --init --recursive
安裝Python軟件包。
conda create --name rephotography python=3.8.5 conda activate rephotography conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch pip install -r requirements.txt
在亞伯拉罕·林肯的示例照片上運行我們的方法。
下載型號:
./scripts/download_checkpoints.sh
跑步:
./scripts/run.sh b "dataset/Abraham Lincoln_01.png" 0.75
您可以通過檢查優化過程
tensorboard --logdir "log/Abraham Lincoln_01"
您可以在下面找到結果。
results/ Abraham Lincoln_01/ # intermediate outputs for histogram matching and face parsing Abraham Lincoln_01_b.png # the input after matching the histogram of the sibling image Abraham Lincoln_01-b-G0.75-init(10,18)-s256-vgg1-vggface0.3-eye0.1-color1.0e+10-cx0.1(relu3_4,relu2_2,relu1_2)-NR5.0e+04-lr0.1_0.01-c32-wp(250,750)-init.png # the sibling image Abraham Lincoln_01-b-G0.75-init(10,18)-s256-vgg1-vggface0.3-eye0.1-color1.0e+10-cx0.1(relu3_4,relu2_2,relu1_2)-NR5.0e+04-lr0.1_0.01-c32-wp(250,750)-init.pt # the sibing latent codes and initialized noise maps Abraham Lincoln_01-b-G0.75-init(10,18)-s256-vgg1-vggface0.3-eye0.1-color1.0e+10-cx0.1(relu3_4,relu2_2,relu1_2)-NR5.0e+04-lr0.1_0.01-c32-wp(250,750).png # the output result Abraham Lincoln_01-b-G0.75-init(10,18)-s256-vgg1-vggface0.3-eye0.1-color1.0e+10-cx0.1(relu3_4,relu2_2,relu1_2)-NR5.0e+04-lr0.1_0.01-c32-wp(250,750).pt # the final optimized latent codes and noise maps Abraham Lincoln_01-b-G0.75-init(10,18)-s256-vgg1-vggface0.3-eye0.1-color1.0e+10-cx0.1(relu3_4,relu2_2,relu1_2)-NR5.0e+04-lr0.1_0.01-c32-wp(250,750)-rand.png # the result with the final latent codes but random noise maps
裁剪和對齊圖像的頭部區域:
python -m tools.data.align_images <input_raw_image_dir> <aligned_image_dir>
跑步:
./scripts/run.sh <spectral_sensitivity> <input_image_path> <blur_radius>
spectral_sensitivity
可以是b
(藍色敏感), gb
(正化)或g
(Panchromatic)。您可以大致估計照片的spectral_sensitivity
,如下所示。在1873年之前使用藍色敏感的模型進行照片,並在1873年至1906年的圖像中手動選擇藍色敏感性和正化的圖像,以及以後拍攝的所有型號。
如果輸入光塊大小為1024x1024,則blur_radius
是像素中估計的高斯模糊半徑。
小路 | 尺寸 | 描述 |
---|---|---|
歷史Wiki Face DataSet.zip | 148 MB | 圖像 |
Spectral_sensitivity.json | 6 KB | 光譜靈敏度( b , gb 或g )。 |
blur_radius.json | 6 KB | 像素中的模糊半徑 |
json
S是映射輸入名稱為相應光譜靈敏度或模糊半徑的字典。由於版權限制, Historical Wiki Face Dataset.zip
包含歷史Wiki Face數據集中的所有圖像,除了毛澤東的照片外,我們在用戶研究中使用了所有圖像。您可以單獨下載並如上所述裁剪。
如果您發現我們的代碼有用,請考慮引用我們的論文:
@article{Luo-Rephotography-2021, author = {Luo, Xuan and Zhang, Xuaner and Yoo, Paul and Martin-Brualla, Ricardo and Lawrence, Jason and Seitz, Steven M.}, title = {Time-Travel Rephotography}, journal = {ACM Transactions on Graphics (Proceedings of ACM SIGGRAPH Asia 2021)}, publisher = {ACM New York, NY, USA}, volume = {40}, number = {6}, articleno = {213}, doi = {https://doi.org/10.1145/3478513.3480485}, year = {2021}, month = {12} }
這項工作是根據MIT許可證獲得許可的。有關詳細信息,請參見許可證。
stylegan2模型的代碼來自https://github.com/rosinality/stylegan2-pytorch。
我們感謝Nick Brandreth捕獲了乾板照片。我們感謝Bo Zhang,Qingnan粉絲,Roy Or-El,Aleksander Holynski和Keunhong Park提供了深刻的建議。我們感謝Xiaojie Feng在COLAB演示上的貢獻。