Savant icon indicating copy to clipboard operation
Savant copied to clipboard

Peoplenet Bug

Open bwsw opened this issue 10 months ago • 0 comments

Peoplenet pipeline leaks memory.

Use ClientSDK, send a still image to the 'sample/template' pipeline. The pipeline will

import json
import os
import time

import cv2
import numpy as np
from savant_rs import telemetry
from savant_rs.telemetry import (
    ContextPropagationFormat,
    Protocol,
    TelemetryConfiguration,
    TracerConfiguration,
)

from savant.api.builder import build_bbox
from savant.client import JaegerLogProvider, JpegSource, SinkBuilder, SourceBuilder

module_hostname = os.environ.get('MODULE_HOSTNAME', 'localhost')
healthcheck_url = f'http://{module_hostname}:8888/status'
source_id = 'test-source'
parent_dir = os.path.dirname(os.path.dirname(__file__))
result_img_path = os.path.join(parent_dir, 'output', 'result_img.jpeg')

# Build the source
source = (
    SourceBuilder()
    .with_socket('dealer+connect:ipc:///tmp/zmq-sockets/input-video.ipc')
    .with_module_health_check_url(healthcheck_url)
    .build()
)

src_jpeg = JpegSource(source_id, file='/test_data/test_img.jpeg', framerate=(1000, 1), pts=int(1000.0 * time.time()))
with open('/test_data/test_img.json', 'r', encoding='utf8') as f:
    src_meta = json.loads(f.read())

counter = 0
while True:
    result = source(src_jpeg, send_eos=False)
    counter += 1
    print(f'Counter: {counter}')

Leak with Peoplenet:

Image

The problem does not happen with YOLO.

bwsw avatar Jan 31 '25 13:01 bwsw