Deepshift / DeepCreamPy

deeppomf's DeepCreamPy + some updates
GNU Affero General Public License v3.0
424 stars 73 forks source link

Bad output results #2

Open yuki-tm opened 1 year ago

yuki-tm commented 1 year ago

Describe the bug Output results for mosaics appear in low-resolution with bright orange patches in masked area. Bar decensors seem to work fine. Original DCP 2.2.0 beta build also seems to work fine.

To Reproduce Steps to reproduce the behavior:

  1. Use Anaconda with a 3.7 environment + required packages.
  2. Run main.py.
  3. Decensor masked images.
  4. Observe results.

Expected behavior Output should not contain bright orange or low resolution patching in masked area.

Screenshots https://i.imgur.com/GqEKp2i.png

Installation method Running source code. Did not install with binary.

Desktop (please complete the following information):

nanoskript commented 1 year ago

This occurs if the model is loaded before self.is_mosaic = True is set in decensor.py. To fix this, add a line in https://github.com/Deepshift/DeepCreamPy/blob/master/main.py in __init__ immediately after self.decensor = Decensor(self) with decensor.is_mosaic = True. Since bar and mosaic decensoring uses different models but only one model is loaded at a time, this will cause bar decensoring to fail.

A more proper fix would be to either load both models separately, or to reinitialize the Decensor class for each decensoring style.