Skip to content

numpy>=1.20: np.int was a deprecated alias for the builtin int #72

@jandoerntlein

Description

@jandoerntlein

Describe the bug
symbol_extraction.py and staffline_extraction.py use "np.int" instead of only "int". This type was deprecated starting with numpy 1.20.

Input Image
This is not dependent on the input image. It is dependent on the used numpy version.

IMPORTANT The issue will be closed directly if you don't provide the image and the issue relates to transcription bugs.

Full Traceback

Matplotlib is building the font cache; this may take a moment.
2025-03-03 08:33:05 No checkpoint found in /.venv/lib/python3.13/site-packages/oemer/checkpoints/unet_big/model.onnx
2025-03-03 08:33:05 Downloading checkpoints (1/4)
1st_model.onnx: 100% 70767752/70767752
2025-03-03 08:33:20 Downloading checkpoints (2/4)
1st_weights.h5: 100% 70977288/70977288
2025-03-03 08:33:34 Downloading checkpoints (3/4)
2nd_model.onnx: 100% 38448467/38448467
2025-03-03 08:33:42 Downloading checkpoints (4/4)
2nd_weights.h5: 100% 38570576/38570576
2025-03-03 08:33:50 Extracting staffline and symbols
/.venv/lib/python3.13/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py:115: UserW
arning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'CoreMLExecutionProvider, AzureExecutionProvider, CPUExecutionProvider'
        if right_bound - end < step_size:
  warnings.warn(
2025-03-03 08:33:50.713967 [W:onnxruntime:, coreml_execution_provider.cc:115 GetCapability] CoreMLExecutionProvider::GetCapability, number of partitions supported by CoreML: 86 number of nodes in the graph: 1577 number of nodes supported by CoreML: 102
1899 1935
2025-03-03 08:34:46 Extracting layers of different symbols
2025-03-03 08:34:46.454388 [W:onnxruntime:, coreml_execution_provider.cc:115 GetCapability] CoreMLExecutionProvider::GetCapability, number of partitions supported by CoreML: 94 number of nodes in the graph: 1619 number of nodes supported by CoreML: 107
1899 1935
2025-03-03 08:36:41 Dewarping
2025-03-03 08:36:43 Extracting stafflines
55 277 Traceback (most recent call last):
  File "/.venv/bin/oemer", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/.venv/lib/python3.13/site-packages/oemer/ete.py", line 276, in main
    mxl_path = extract(args)
  File "//.venv/lib/python3.13/site-packages/oemer/ete.py", line 167, in extract
    staffs, zones = staff_extract()
                    ~~~~~~~~~~~~~^^
  File "/.venv/lib/python3.13/site-packages/oemer/staffline_extraction.py", line 327, in extract
    rr = np.array(rr, dtype=np.int)
                            ^^^^^^
  File "/.venv/lib/python3.13/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(__former_attrs__[attr], name=None)
AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.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

Command You Execute
oemer xyz.jpg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions