12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- from ipfml import processing, metrics, utils
- from modules.utils.config import *
- from preprocessing_functions import svd_reconstruction
- from PIL import Image
- from skimage import color
- from sklearn.decomposition import FastICA
- from sklearn.decomposition import IncrementalPCA
- from sklearn.decomposition import TruncatedSVD
- from numpy.linalg import svd as lin_svd
- from scipy.signal import medfilt2d, wiener, cwt
- import pywt
- import numpy as np
- _scenes_names_prefix = '_scenes_names'
- _scenes_indices_prefix = '_scenes_indices'
- # store all variables from current module context
- context_vars = vars()
- def get_data(data_type, block, interval=(100, 200)):
- """
- Method which returns the data type expected
- """
- if data_type == 'svd_reconstruct':
- begin, end = interval
- data = svd_reconstruction(block, [begin, end])
- return data
- def get_renderer_scenes_indices(renderer_name):
- if renderer_name not in renderer_choices:
- raise ValueError("Unknown renderer name")
- if renderer_name == 'all':
- return scenes_indices
- else:
- return context_vars[renderer_name + _scenes_indices_prefix]
- def get_renderer_scenes_names(renderer_name):
- if renderer_name not in renderer_choices:
- raise ValueError("Unknown renderer name")
- if renderer_name == 'all':
- return scenes_names
- else:
- return context_vars[renderer_name + _scenes_names_prefix]
|