warmshao / FasterLivePortrait

Bring portraits to life in Real Time!onnx/tensorrt support!实时肖像驱动!
508 stars 48 forks source link

TensorRT model seems remembered last result? #15

Closed vpckso closed 3 months ago

vpckso commented 3 months ago

If I run AppearanceFeatureExtractorModel to get f1 and run AppearanceFeatureExtractorModel on another image to get f2 then I pass f1 to WarpingSpadeModel, but the result is same as f2

To demonstrate the problem, add

self.prepare_retargeting('assets/examples/source/s7.jpg', flag_do_crop)

to https://github.com/warmshao/FasterLivePortrait/blob/master/src/pipelines/gradio_live_portrait_pipeline.py#L131

Although passed f_s_user to WarpingSpadeModel, the appearance is s7.jpg retarget

vpckso commented 3 months ago

Found can fix by f_s_user = f_s_user.copy() before 2nd call. I think this should be optimization that reuse same memory, and not a bug.