ผู้คนในประวัติศาสตร์หลายคนถูกจับโดยภาพถ่ายเก่าจาง ๆ สีดำและสีขาวที่บิดเบี้ยวเนื่องจากข้อ จำกัด ของกล้องต้นและเวลาผ่านไป บทความนี้จำลองการเดินทางย้อนเวลากลับไปพร้อมกับกล้องที่ทันสมัยเพื่อถ่ายทอดวิชาที่มีชื่อเสียง ซึ่งแตกต่างจากตัวกรองการฟื้นฟูภาพทั่วไปที่ใช้การดำเนินงานอิสระเช่น denoising, การทำสีและการแก้ปัญหา superresolution เราใช้ประโยชน์จากเฟรมเวิร์ก Stylegan2 เพื่อฉายภาพเก่าในพื้นที่ของภาพถ่ายความละเอียดสูงที่ทันสมัย ความท้าทายที่ไม่เหมือนใครด้วยวิธีการนี้คือการรักษาตัวตนและท่าทางของเรื่องในภาพถ่ายต้นฉบับในขณะที่ทิ้งสิ่งประดิษฐ์จำนวนมากที่พบบ่อยในภาพถ่ายโบราณคุณภาพต่ำ การเปรียบเทียบของเรากับตัวกรองการฟื้นฟูที่ทันสมัยในปัจจุบันแสดงการปรับปรุงที่สำคัญและผลลัพธ์ที่น่าสนใจสำหรับผู้คนในประวัติศาสตร์ที่สำคัญหลากหลาย
การถ่ายทอดการเดินทางข้ามเวลา
Xuan Luo, Xuaner Zhang, Paul Yoo, Ricardo Martin-Brualla, Jason Lawrence และ Steven M. Seitz
ใน Siggraph Asia 2021
เราให้การสาธิตที่เริ่มต้นง่ายโดยใช้ Google Colab! colab จะช่วยให้คุณลองใช้วิธีการของเราในตัวอย่าง Abraham Lincoln Photo หรือ ภาพถ่ายของคุณเอง โดยใช้ Cloud GPU บน Google Colab
หรือคุณสามารถเรียกใช้วิธีการของเราบนเครื่องของคุณเองตามคำแนะนำด้านล่าง
ดึงแพ็คเกจบุคคลที่สาม
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
(orthochromatic) หรือ g
(panchromatic) คุณสามารถประเมิน spectral_sensitivity
ของภาพถ่ายของคุณได้อย่างคร่าวๆ ใช้โมเดล ที่ไวต่อสีน้ำเงิน สำหรับภาพถ่ายก่อนปี 1873 เลือกด้วยตนเองระหว่างสีน้ำเงินที่ไวต่อแสงและ orthochromatic สำหรับภาพตั้งแต่ปี 1873 ถึง 1906 และในทุกรุ่นสำหรับภาพถ่ายที่ถ่ายในภายหลัง
blur_radius
เป็นรัศมีการเบลอแบบเกาส์เซียนโดยประมาณในพิกเซลหากโฟโตอินพุตถูกปรับขนาดเป็น 1024x1024
เส้นทาง | ขนาด | คำอธิบาย |
---|---|---|
Historical 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 ในอดีต ที่ใช้ในการศึกษาผู้ใช้ของเรายกเว้นภาพถ่ายของ Mao Zedong คุณสามารถดาวน์โหลดแยกต่างหากและครอบตัดตามด้านบน
หากคุณพบว่ารหัสของเรามีประโยชน์โปรดพิจารณาอ้างถึงบทความของเรา:
@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 Fan, Roy Or-El, Aleksander Holynski และ Keunhong Park สำหรับคำแนะนำที่ลึกซึ้ง เราขอขอบคุณ Xiaojie Feng สำหรับการมีส่วนร่วมในการสาธิต Colab