zhouyuchong / face-recognition-deepstream

Deepstream app use retinaface and arcface for face recognition.
MIT License
60 stars 13 forks source link

where is the output #17

Closed xxiMiaxx closed 2 years ago

xxiMiaxx commented 2 years ago

Hello,

Thank you for creating this repository!

I can't find the output, i'm not sure if the script is actually reading the video, I get the following output (for one stream):


localhost:9092
--------- start app ------------------
pipeline ++++++++++
/opt/nvidia/deepstream/deepstream-6.1/sources/apps/sample_apps/deepstream_python_apps/apps/face-recognition-deepstream/src/kbds/configs/face/config_retinaface.txt
/opt/nvidia/deepstream/deepstream-6.1/sources/apps/sample_apps/deepstream_python_apps/apps/face-recognition-deepstream/src/kbds/configs/face/config_arcface.txt
localhost;9092;deepstream

Before thread++++++++++++++++++++++++++++
After thread++++++++++++++++++++++++++++
(True, 'success, state <enum GST_STATE_CHANGE_SUCCESS of type Gst.StateChangeReturn>')
-----------------------------------------------------------------------------
set index of src task-0 to 0
add set return : <enum GST_STATE_CHANGE_ASYNC of type Gst.StateChangeReturn>
Starting pipeline 

GstMessageError, gerror=(GError)NULL, debug=(string)"gstnvmsgbroker.cpp\(401\):\ legacy_gst_nvmsgbroker_start\ \(\):\ /GstPipeline:pipeline0/GstNvMsgBroker:nvmsg-broker:\012unable\ to\ connect\ to\ broker\ library"; ##########################
what is search index:    None
Traceback (most recent call last):
  File "/opt/nvidia/deepstream/deepstream-6.1/sources/apps/sample_apps/deepstream_python_apps/apps/face-recognition-deepstream/test/../src/kbds/core/pipeline.py", line 124, in bus_call_abs
    search_index = search_index[0].split('-')[2][:-1]
TypeError: 'NoneType' object is not subscriptable
GstMessageError, gerror=(GError)NULL, debug=(string)"gstbasesink.c\(5367\):\ gst_base_sink_change_state\ \(\):\ /GstPipeline:pipeline0/GstNvMsgBroker:nvmsg-broker:\012Failed\ to\ start"; ##########################
what is search index:    None
Traceback (most recent call last):
  File "/opt/nvidia/deepstream/deepstream-6.1/sources/apps/sample_apps/deepstream_python_apps/apps/face-recognition-deepstream/test/../src/kbds/core/pipeline.py", line 124, in bus_call_abs
    search_index = search_index[0].split('-')[2][:-1]
TypeError: 'NoneType' object is not subscriptable
(True, 'success')
src: <Stream task-0 task-0-Stream> 
source_bin: <__gi__.GstURIDecodeBin object at 0x7f5bd2a80800 (GstURIDecodeBin at 0x3d0c760)>
<enum GST_STATE_CHANGE_ASYNC of type Gst.StateChangeReturn>
++++++++++++++++++++++++++++++++++++++++++
doneeeeeeeeeeeeeeeeeeee
gstname= video/x-raw
pad name:  sink_0
Decodebin linked to pipeline
GstMessageError, gerror=(GError)NULL, debug=(string)"gstmultiqueue.c\(2065\):\ gst_multi_queue_loop\ \(\):\ /GstPipeline:pipeline0/GstURIDecodeBin:source-bin-0/GstDecodeBin:decodebin1/GstMultiQueue:multiqueue0:\012streaming\ stopped\,\ reason\ error\ \(-5\)", details=(structure)"details\,\ flow-return\=\(int\)-5\;"; ##########################
what is search index:    <re.Match object; span=(147, 160), match='source-bin-0/'>
After change search index:    0
delete finished
id: task-0,  error: gst-stream-error-quark: Internal data stream error. (1), delete.

**PERF:  {'stream0': 0.0} 

**PERF:  {'stream0': 0.0} 

**PERF:  {'stream0': 0.0} 

**PERF:  {'stream0': 0.0} 

**PERF:  {'stream0': 0.0} 

the folder test/images with it's directories (aligned and original) remains unchanged .

after this log there is no visualization or saved results, please let me know what i'm doing wrong and how i can access the results.

zhouyuchong commented 2 years ago

@xxiMiaxx it seems there is something wrong with your kafka config.

GstMessageError, gerror=(GError)NULL, debug=(string)"gstnvmsgbroker.cpp(401):\ legacy_gst_nvmsgbroker_start\ ():\ /GstPipeline:pipeline0/GstNvMsgBroker:nvmsg-broker:\012unable\ to\ connect\ to\ broker\ library";

I use fakesink to replace elgglesink so no visualization. If you run codes successfully, there would be output in console and saved results.

xxiMiaxx commented 2 years ago

which kafka version are you using?

mine is 2.0.2 and i'm running the code inside a deepstream 6.1 container.

Also when I run the script as is I get this error

Traceback (most recent call last):
  File "face_test_demo.py", line 8, in <module>
    app = DSFace("localhost;9092;deepstream")
  File "/opt/nvidia/deepstream/deepstream-6.1/sources/apps/sample_apps/deepstream_python_apps/apps/face-recognition-deepstream/test/../src/kbds/app/face/face.py", line 63, in __init__
    super().__init__(conn_str=conn_str)
  File "/opt/nvidia/deepstream/deepstream-6.1/sources/apps/sample_apps/deepstream_python_apps/apps/face-recognition-deepstream/test/../src/kbds/core/pipeline.py", line 78, in __init__
    self.producer = init_bus_kafka(config=conn_str)
  File "/opt/nvidia/deepstream/deepstream-6.1/sources/apps/sample_apps/deepstream_python_apps/apps/face-recognition-deepstream/test/../src/kbds/util/bus_kafka.py", line 10, in init_bus_kafka
    producer = KafkaProducer(bootstrap_servers=[conn_str])
  File "/usr/local/lib/python3.8/dist-packages/kafka/producer/kafka.py", line 381, in __init__
    client = KafkaClient(metrics=self._metrics, metric_group_prefix='producer',
  File "/usr/local/lib/python3.8/dist-packages/kafka/client_async.py", line 244, in __init__
    self.config['api_version'] = self.check_version(timeout=check_timeout)
  File "/usr/local/lib/python3.8/dist-packages/kafka/client_async.py", line 900, in check_version
    raise Errors.NoBrokersAvailable()
kafka.errors.NoBrokersAvailable: NoBrokersAvailable

but when I change the kafka producer from

producer = KafkaProducer(bootstrap_servers=[conn_str])

To: 
    producer=KafkaProducer(bootstrap_servers=['localhost:9091'],
              api_version=(0,11,5),
              value_serializer=lambda x: dumps(x).encode('utf-8'))

it gets past this error.

zhouyuchong commented 2 years ago

@xxiMiaxx mine is kafka_2.12-3.1.0 and if you just want to test, you can delete this and its related codes. This kafka producer is to send error messages in bus call.

xxiMiaxx commented 2 years ago

Thank you @zhouyuchong for pointing out that it was kafka!

I have followed the steps in https://kafka.apache.org/quickstart to create a Kafka topic and a ZooKeeper service and a Kafka broker service then I ran the code test/face_test_demo.py.

cloudlakecho commented 1 year ago

@xxiMiaxx Thanks for posting your problem.

Is your post on your question during runtime of "python face_test_demo.py"?

Your runtime looks vastly different from mine somehow. Was your input a RTSP?