Closed LLdotcom closed 1 year ago
You should be able to change the np.int to np.int64
That should do the work.
Thanks, changing np.int to np.int64 fixed it.
If anyone wants to make a pr for this..
El mié, 24 de may de 2023 14:30, LLdotcom @.***> escribió:
Thanks, changing np.int to np.int64 fixed it.
— Reply to this email directly, view it on GitHub https://github.com/nadermx/backgroundremover/issues/78#issuecomment-1561886375, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYACXAMC2UQWI55T3KKN63XHZVURANCNFSM6AAAAAAYKS4ZXA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
If anyone wants to make a pr for this.. El mié, 24 de may de 2023 14:30, LLdotcom @.> escribió: … Thanks, changing np.int to np.int64 fixed it. — Reply to this email directly, view it on GitHub <#78 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYACXAMC2UQWI55T3KKN63XHZVURANCNFSM6AAAAAAYKS4ZXA . You are receiving this because you are subscribed to this thread.Message ID: @.>
I have make a pr for this: https://github.com/nadermx/backgroundremover/pull/79
The command: backgroundremover -i "cute-ferret-is-sleeping.jpg" -o "test.png" works fine.
But if I try turning on alpha matting with the command: backgroundremover -i "cute-ferret-is-sleeping.jpg" -a -ae 15 -o "test.png" it fails.
I installed via pipx rather than pip, but I also tested in a virtual box (Ubuntu and Manjaro) using pip getting the same error as below:
Traceback (most recent call last): File "/home/sde/.local/bin/backgroundremover", line 8, in
sys.exit(main())
File "/home/sde/.local/pipx/venvs/backgroundremover/lib/python3.10/site-packages/backgroundremover/cmd/cli.py", line 239, in main
remove(
File "/home/sde/.local/pipx/venvs/backgroundremover/lib/python3.10/site-packages/backgroundremover/bg.py", line 188, in remove
cutout = alpha_matting_cutout(
File "/home/sde/.local/pipx/venvs/backgroundremover/lib/python3.10/site-packages/backgroundremover/bg.py", line 131, in alpha_matting_cutout
structure = np.ones((erode_structure_size, erode_structure_size), dtype=np.int)
File "/home/sde/.local/pipx/venvs/backgroundremover/lib/python3.10/site-packages/numpy/init.py", line 305, in getattr
raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'int'.
np.int
was a deprecated alias for the builtinint
. To avoid this error in existing code, useint
by itself. Doing this will not modify any behavior and is safe. When replacingnp.int
, you may wish to use e.g.np.int64
ornp.int32
to specify the precision. If you wish to review your current use, check the release note link for additional information. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?