跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[Python] 用 yolo 做实时视频检测, 摄像头接入超过 3 路, Python 内存占用就飙高,请问有没有解决办法?

发表于

问一下做过实时视频检测的大佬,我现在用 opencv 获取摄像头的数据,如果超过 3 路以后, python 的内存占用就飙上去了,基本的实现逻辑如下:

vid = cv2.VideoCapture('rtmp_url') 
while(True): 
    # Capture the video frame 
    # by frame 
    ret, frame = vid.read() 
    queue.put(frame)

上面代码跑在 python 的 thread 里,3 路视频就 3 个 thread, 感觉这里线程之前有竞争导致一个摄像头数据取完了,另一个没有取,就堆积下来了,然后内存占用就上去了, 我感觉好像还没到 yolo 的 predict , 就是多线程获取 camera 的数据,就会造成内存占用过高

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.