Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy VisibleDeprecationWarning #1625

Closed
cawilchesp opened this issue Nov 9, 2023 · 3 comments
Closed

Numpy VisibleDeprecationWarning #1625

cawilchesp opened this issue Nov 9, 2023 · 3 comments

Comments

@cawilchesp
Copy link

🐛 Describe the bug

During prediction, a warning from Numpy showed only one time:

with sv.VideoSink(target_path=f"{target}.avi", video_info=video_info, codec="H264") as sink:
        for image in tqdm(frame_generator, total=video_info.total_frames, unit='frames'):
            annotated_image = image.copy()

            # Process YOLO-NAS detections
            results = list(yolo_nas_model.predict(image, conf=CONFIDENCE, fuse_model=False))[0]

The message is:
C:\anaconda3\envs\vision\lib\site-packages\numpy\lib\arraypad.py:487: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
x = np.array(x)

Versions

Numpy 1.23.0

@BloodAxe
Copy link
Collaborator

BloodAxe commented Nov 9, 2023

What is sv.VideoSink in this snippet?

@cawilchesp
Copy link
Author

What is sv.VideoSink in this snippet?

I'm sorry for not including more code, sv is for: import supervision as sv.
sv.VideoSink is to save a video from the processed frames.

The warning message appears only when executing the first time the line: results = list(yolo_nas_model.predict(image, conf=CONFIDENCE, fuse_model=False))[0]

I hope that helps

@BloodAxe
Copy link
Collaborator

We have a fix for that already which will land in 3.4.1 next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants