RedisGears / EdgeRealtimeVideoAnalytics

An example of using Redis Streams, RedisGears, RedisAI and RedisTimeSeries for Realtime Video Analytics (i.e. counting people)
https://redisgears.io
Apache License 2.0
397 stars 69 forks source link

Need to add more camera streams to the code #28

Open karanveersingh5623 opened 4 years ago

karanveersingh5623 commented 4 years ago

Hi , How can we add more simultaneous camera streams or video playback streams to the environment? In gears.py , the camera:0 is hardcoded. How can we handle multiple cameras when executing gears.py through redis gears in init.py .

MeirShpilraien commented 4 years ago

The stream reader can register to prefix of streams so instead register("camera:0") you can do register(prefix="camera:*"). This way the image analysis code will be triggered for each stream with the prefix camera:

MeirShpilraien commented 4 years ago

https://oss.redislabs.com/redisgears/readers.html#streamreader

karanveersingh5623 commented 4 years ago

Thanks for the info buddy but its throwing exception with prefix .... check the below trace . Any way forward .

Jamess-Mac-Pro:Redisai_edgeAnalytics_old karanveer$ docker logs 74b9038b5bbd Loading model - b'OK' Loading script - b'OK' Creating timeseries keys and downsampling rules - [b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK', b'OK'] Traceback (most recent call last): File "init.py", line 70, in res = conn.execute_command('RG.PYEXECUTE', gear) File "/usr/local/lib/python3.7/site-packages/redis/client.py", line 775, in execute_command return self.parse_response(connection, command_name, **options) File "/usr/local/lib/python3.7/site-packages/redis/client.py", line 789, in parse_response response = connection.read_response() File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 642, in read_response raise response redis.exceptions.ResponseError: deco() got an unexpected keyword argument 'prefix' Loading gear - Jamess-Mac-Pro:Redisai_edgeAnalytics_old karanveer$ `

MeirShpilraien commented 4 years ago

Seems like a very old version of RedisGears, try to pass it without a named argument like register("camera:*")

karanveersingh5623 commented 4 years ago

Did that as well , no exceptions but nothing shows up in grafana like boxes and people counting , it streams a plain video

karanveersingh5623 commented 4 years ago

do we need to change anything in def storeResults(x) , there are multiple entries for camera:0

MeirShpilraien commented 4 years ago

Can you share the output of RG.DUMPREGISTRATIONS? Also can you share the RedisGears version you are using?

MeirShpilraien commented 4 years ago

We have discord for instant messaging, maybe it will be easier to chat there? https://discord.com/invite/6yaVTtp

karanveersingh5623 commented 4 years ago

pinged you as karanveer