data.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from ipfml import processing, metrics, utils
  2. from modules.utils.config import *
  3. from transformation_functions import svd_reconstruction
  4. from PIL import Image
  5. from skimage import color
  6. from sklearn.decomposition import FastICA
  7. from sklearn.decomposition import IncrementalPCA
  8. from sklearn.decomposition import TruncatedSVD
  9. from numpy.linalg import svd as lin_svd
  10. from scipy.signal import medfilt2d, wiener, cwt
  11. import pywt
  12. import numpy as np
  13. _scenes_names_prefix = '_scenes_names'
  14. _scenes_indices_prefix = '_scenes_indices'
  15. # store all variables from current module context
  16. context_vars = vars()
  17. def get_renderer_scenes_indices(renderer_name):
  18. if renderer_name not in renderer_choices:
  19. raise ValueError("Unknown renderer name")
  20. if renderer_name == 'all':
  21. return scenes_indices
  22. else:
  23. return context_vars[renderer_name + _scenes_indices_prefix]
  24. def get_renderer_scenes_names(renderer_name):
  25. if renderer_name not in renderer_choices:
  26. raise ValueError("Unknown renderer name")
  27. if renderer_name == 'all':
  28. return scenes_names
  29. else:
  30. return context_vars[renderer_name + _scenes_names_prefix]