danielroich / PTI

Official Implementation for "Pivotal Tuning for Latent-based editing of Real Images" (ACM TOG 2022) https://arxiv.org/abs/2106.05744
MIT License
897 stars 112 forks source link

it's any method to speed up? #25

Closed mapleyuan closed 3 years ago

mapleyuan commented 3 years ago

hi guys, i want to make it test online.but it's too slow because the embedding generator need about 35 mins.

danielroich commented 3 years ago

Hey @mapleyuan Did you run the PTI method using CPU? If you have GPU make sure you configure the inference correctly, by default PTI uses GPU. While using GPU you should receive results after ~2 minutes and afterwards each edit is instant.

Also check if you are using the method correctly, even if you are using CPU it should run for about 10 minutes, not 35.

If you cannot access GPU resources, you could try to scale up the code by using parallel tuning, I haven't tried it so far but it sounds the best option considering you have only CPU available. It will require making code changes.

Daniel

mapleyuan commented 3 years ago

hey @danielroich, yeah i Have used cpu to run it and i test several times about 35mins. I will try run it on gpu online machines,

but I still have meet the problem how to make it faster. is it impossible to control it in few seconds about 5 second ?

I am a new hand Could you give me more detail advise? thx!

johndpope commented 3 years ago

results will be impacted - but you can cut back the max_pti_steps

Steps

LPIPS_value_threshold = 0.06 max_pti_steps = 350 first_inv_steps = 450 max_images_to_invert = 30

mapleyuan commented 3 years ago

@johndpope I had reduced the steps but the result is bad 0.0

johndpope commented 3 years ago

Just use google cloud or upgrade gpu..... welcome to modern day machine learning.