USDSeg-FCOS icon indicating copy to clipboard operation
USDSeg-FCOS copied to clipboard

shape dictionary

Open HUSTxyy opened this issue 3 years ago • 1 comments

Hi! Sorry to bother you. Does the code of Shape Dictionary include in the git? I mean the generation of shape dictionary,I don't find it in your code. If you could offer the part of code,I would appreciate it!

HUSTxyy avatar Nov 21 '22 08:11 HUSTxyy

Hi,

To generate the dictionary, you can follow the following code snippet.

Note that images should be of shape (N, M), where $N$ is the number of samples, and $M$ is the resolution of each mask, e.g., $64*64=4096$

from sklearn.decomposition import DictionaryLearning

dico = DictionaryLearning(n_components=n_components, n_jobs=-1, max_iter=n_iter, verbose=True)
dico.fit(images)

ElectronicElephant avatar Nov 28 '22 07:11 ElectronicElephant