You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example bellow does not work because it expects a numpy data from input. The code should also consider cupy data. Specially for workflows that are handling data directly from GPU.
importcupyascpfromPILimportImage# Here, we load in the array# We divide the image by / 16 as it'll take too longar=cp.asarray(Image.open("../../data/image.jpg"))[::4,::4]
# We may use the class variant to run GLCMfromglcm_cupyimportGLCM, Directiong=GLCM(
directions=(Direction.EAST, Direction.SOUTH_EAST),
bin_from=256, bin_to=16).run(ar)
# Alternatively, use the function variantfromglcm_cupyimportglcmg=glcm(ar, bin_from=256, bin_to=16)
# We yield the features using constants defined in conffromglcm_cupy.confimportCONTRAST, CORRELATION, ASMprint(g[..., CONTRAST])
print(g[..., CORRELATION])
print(g[..., ASM])
# Alternatively, since these constants are simply integersprint(g[..., 0])
print(g[..., 1])
print(g[..., 2])
It returns basically a TypeError:
TypeError: `arr_in`mustbeanumpyndarray
The text was updated successfully, but these errors were encountered:
Thanks @Eve-ning . I appreciate your help. I would not like to submit a PR because you can decide how you could implement this. If you need any help. Just let me know.
The example bellow does not work because it expects a numpy data from input. The code should also consider cupy data. Specially for workflows that are handling data directly from GPU.
It returns basically a
TypeError
:The text was updated successfully, but these errors were encountered: