py-glcm
py-glcm copied to clipboard
No Garbage Collection
Allocate new numpy array inside various feature computation functions such as PyArray_diff_entropy
but no garbage collection stragety:
feature = (PyArrayObject*) PyArray_ZEROS(ndim - 2, shape, NPY_DOUBLE, 0);
for i in tqdm.tqdm(range(100000)):
glcm = op.glcm(patch, [1], [1, 2, 3, 4], mode="raw", bins=256, normalized=True, check=False)
op.glcm_features(glcm, op.contrast)
Run for loop will cause increasing memory.
I'll check into it. I assume there are some issues with the garbage collection of python itself in regards to the c++ code.