greentfrapp / lucent

Lucid library adapted for PyTorch
Apache License 2.0
597 stars 89 forks source link

Fixing render_vis side effect on transforms #15

Closed slawekslex closed 3 years ago

slawekslex commented 3 years ago

SUMMARY: The render.render_vis function used to append to the transforms list passed to it. You can see it for the example in the tutorial.ipynb notebook by inspecting the all_transforms list - it got added preprocess_inceptionv1 and Upscale for each time it was used. As a result if you run a cell couple of times it would eventually stop working.

TEST PLAN: Tested with passing both a custom array of transforms and None. Validated that the code works and neither custom array nor transform.standard_transforms gets modified.

greentfrapp commented 3 years ago

Awesome, good catch and thank you so much @slawekslex!