Event-Driven Architecture in Python (Real-Time Computer Vision Application) /u/luv-music-will-travl Python Education

Event-Driven Architecture in Python (Real-Time Computer Vision Application) /u/luv-music-will-travl Python Education

I’m brand new to event-driven architecture. I’ve done my best to get a lay of the land learning about things like producers, consumers, backpressure, synchronization, reactive streams, etc… I’ve also come across a few (seemingly) relevant Python frameworks: quix-streams, dask, faust, and RxPY. However, my use case has additional complications that my readings so far haven’t addressed.

Context

I’m working on a real-time computer vision pipeline. I have frames coming from one (or more) cameras that are used to reconstruct a scene in real-time. Later in the pipeline, the reconstructed scene is monitored and events are fired that trigger real-time alerts to the user.

The scene reconstruction pipeline consists of many tasks (e.g. object detection models, point cloud construction, etc…) with various dependencies between them. Eventually, this leads to a final task with input from a few prior tasks and a single output: the reconstructed scene. Most of my complications arise in this pipeline.

  1. When a frame comes, multiple tasks can start processing it. If each of these tasks is thought of as a consumer, it’s not feasible to manage backpressure for each separately. There needs to be consistency in the frame dropping logic since all these consumers will eventually result in that single scene reconstruction output.
  2. Some tasks in the pipeline will depend on the result from processing the previous frame.
  3. For tasks that don’t depend on the result from a previous frame (e.g. object detection model inference), it should be possible for multiple frames to be processed at once to increase throughput.

Questions

I know this is a lot. Thank you for reading this far! I have a few questions. Answers to any would be much appreciated!

  1. Are there any resources you’d recommend that would be particularly relevant to my use case? Are there other subreddits that might be worth posing this question?
  2. Is there something fundamentally wrong with my approach here? I wasn’t able to find much about event-drive architecture as it relates to real-time computer vision systems.
  3. Of the frameworks I mentioned, has anyone spent time using them? Is there one in particular that stands out as a good candidate for my use case? Are there others I should look into?

submitted by /u/luv-music-will-travl
[link] [comments]

​r/learnpython I’m brand new to event-driven architecture. I’ve done my best to get a lay of the land learning about things like producers, consumers, backpressure, synchronization, reactive streams, etc… I’ve also come across a few (seemingly) relevant Python frameworks: quix-streams, dask, faust, and RxPY. However, my use case has additional complications that my readings so far haven’t addressed. Context I’m working on a real-time computer vision pipeline. I have frames coming from one (or more) cameras that are used to reconstruct a scene in real-time. Later in the pipeline, the reconstructed scene is monitored and events are fired that trigger real-time alerts to the user. The scene reconstruction pipeline consists of many tasks (e.g. object detection models, point cloud construction, etc…) with various dependencies between them. Eventually, this leads to a final task with input from a few prior tasks and a single output: the reconstructed scene. Most of my complications arise in this pipeline. When a frame comes, multiple tasks can start processing it. If each of these tasks is thought of as a consumer, it’s not feasible to manage backpressure for each separately. There needs to be consistency in the frame dropping logic since all these consumers will eventually result in that single scene reconstruction output. Some tasks in the pipeline will depend on the result from processing the previous frame. For tasks that don’t depend on the result from a previous frame (e.g. object detection model inference), it should be possible for multiple frames to be processed at once to increase throughput. Questions I know this is a lot. Thank you for reading this far! I have a few questions. Answers to any would be much appreciated! Are there any resources you’d recommend that would be particularly relevant to my use case? Are there other subreddits that might be worth posing this question? Is there something fundamentally wrong with my approach here? I wasn’t able to find much about event-drive architecture as it relates to real-time computer vision systems. Of the frameworks I mentioned, has anyone spent time using them? Is there one in particular that stands out as a good candidate for my use case? Are there others I should look into? submitted by /u/luv-music-will-travl [link] [comments] 

I’m brand new to event-driven architecture. I’ve done my best to get a lay of the land learning about things like producers, consumers, backpressure, synchronization, reactive streams, etc… I’ve also come across a few (seemingly) relevant Python frameworks: quix-streams, dask, faust, and RxPY. However, my use case has additional complications that my readings so far haven’t addressed.

Context

I’m working on a real-time computer vision pipeline. I have frames coming from one (or more) cameras that are used to reconstruct a scene in real-time. Later in the pipeline, the reconstructed scene is monitored and events are fired that trigger real-time alerts to the user.

The scene reconstruction pipeline consists of many tasks (e.g. object detection models, point cloud construction, etc…) with various dependencies between them. Eventually, this leads to a final task with input from a few prior tasks and a single output: the reconstructed scene. Most of my complications arise in this pipeline.

  1. When a frame comes, multiple tasks can start processing it. If each of these tasks is thought of as a consumer, it’s not feasible to manage backpressure for each separately. There needs to be consistency in the frame dropping logic since all these consumers will eventually result in that single scene reconstruction output.
  2. Some tasks in the pipeline will depend on the result from processing the previous frame.
  3. For tasks that don’t depend on the result from a previous frame (e.g. object detection model inference), it should be possible for multiple frames to be processed at once to increase throughput.

Questions

I know this is a lot. Thank you for reading this far! I have a few questions. Answers to any would be much appreciated!

  1. Are there any resources you’d recommend that would be particularly relevant to my use case? Are there other subreddits that might be worth posing this question?
  2. Is there something fundamentally wrong with my approach here? I wasn’t able to find much about event-drive architecture as it relates to real-time computer vision systems.
  3. Of the frameworks I mentioned, has anyone spent time using them? Is there one in particular that stands out as a good candidate for my use case? Are there others I should look into?

submitted by /u/luv-music-will-travl
[link] [comments]  I’m brand new to event-driven architecture. I’ve done my best to get a lay of the land learning about things like producers, consumers, backpressure, synchronization, reactive streams, etc… I’ve also come across a few (seemingly) relevant Python frameworks: quix-streams, dask, faust, and RxPY. However, my use case has additional complications that my readings so far haven’t addressed. Context I’m working on a real-time computer vision pipeline. I have frames coming from one (or more) cameras that are used to reconstruct a scene in real-time. Later in the pipeline, the reconstructed scene is monitored and events are fired that trigger real-time alerts to the user. The scene reconstruction pipeline consists of many tasks (e.g. object detection models, point cloud construction, etc…) with various dependencies between them. Eventually, this leads to a final task with input from a few prior tasks and a single output: the reconstructed scene. Most of my complications arise in this pipeline. When a frame comes, multiple tasks can start processing it. If each of these tasks is thought of as a consumer, it’s not feasible to manage backpressure for each separately. There needs to be consistency in the frame dropping logic since all these consumers will eventually result in that single scene reconstruction output. Some tasks in the pipeline will depend on the result from processing the previous frame. For tasks that don’t depend on the result from a previous frame (e.g. object detection model inference), it should be possible for multiple frames to be processed at once to increase throughput. Questions I know this is a lot. Thank you for reading this far! I have a few questions. Answers to any would be much appreciated! Are there any resources you’d recommend that would be particularly relevant to my use case? Are there other subreddits that might be worth posing this question? Is there something fundamentally wrong with my approach here? I wasn’t able to find much about event-drive architecture as it relates to real-time computer vision systems. Of the frameworks I mentioned, has anyone spent time using them? Is there one in particular that stands out as a good candidate for my use case? Are there others I should look into? submitted by /u/luv-music-will-travl [link] [comments]

Read more

Feeling unmotivated, hopeless about to fail my tech class in high school due to difficulties with python. /u/MCSmashFan Python Education

Feeling unmotivated, hopeless about to fail my tech class in high school due to difficulties with python. /u/MCSmashFan Python Education

So I’m currently taking a tech class in high school currently learning python and I’m so god damn behind. Like when it comes to writing big lines of codes it’s really difficult for me.. everytime whenever I get home I promise myself to practice the codes for tests but I feel so unmotivated and hopeless. like everyone else is able to code simple pygame but I’m just stuck with trying to understand some basic fundamentals. I honestly feel so freaking dumb and stupid. I do have ADHD and autism which affects my executive functioning.

submitted by /u/MCSmashFan
[link] [comments]

​r/learnpython So I’m currently taking a tech class in high school currently learning python and I’m so god damn behind. Like when it comes to writing big lines of codes it’s really difficult for me.. everytime whenever I get home I promise myself to practice the codes for tests but I feel so unmotivated and hopeless. like everyone else is able to code simple pygame but I’m just stuck with trying to understand some basic fundamentals. I honestly feel so freaking dumb and stupid. I do have ADHD and autism which affects my executive functioning. submitted by /u/MCSmashFan [link] [comments] 

So I’m currently taking a tech class in high school currently learning python and I’m so god damn behind. Like when it comes to writing big lines of codes it’s really difficult for me.. everytime whenever I get home I promise myself to practice the codes for tests but I feel so unmotivated and hopeless. like everyone else is able to code simple pygame but I’m just stuck with trying to understand some basic fundamentals. I honestly feel so freaking dumb and stupid. I do have ADHD and autism which affects my executive functioning.

submitted by /u/MCSmashFan
[link] [comments]  So I’m currently taking a tech class in high school currently learning python and I’m so god damn behind. Like when it comes to writing big lines of codes it’s really difficult for me.. everytime whenever I get home I promise myself to practice the codes for tests but I feel so unmotivated and hopeless. like everyone else is able to code simple pygame but I’m just stuck with trying to understand some basic fundamentals. I honestly feel so freaking dumb and stupid. I do have ADHD and autism which affects my executive functioning. submitted by /u/MCSmashFan [link] [comments]

Read more

Typing: What do you use for linting? mypy, pyre or both? /u/NotAMotivRep Python Education

Typing: What do you use for linting? mypy, pyre or both? /u/NotAMotivRep Python Education

What are the relative strengths and weaknesses of each?

submitted by /u/NotAMotivRep
[link] [comments]

​r/learnpython What are the relative strengths and weaknesses of each? submitted by /u/NotAMotivRep [link] [comments] 

What are the relative strengths and weaknesses of each?

submitted by /u/NotAMotivRep
[link] [comments]  What are the relative strengths and weaknesses of each? submitted by /u/NotAMotivRep [link] [comments]

Read more

Best Resources to Learn DSA in Python? /u/PretendPiglet7954 Python Education

Best Resources to Learn DSA in Python? /u/PretendPiglet7954 Python Education

Hello everyone!

I’m looking for beginner-friendly resources to learn Data Structures and Algorithms (DSA) using Python. My main focus is to build a strong foundation and improve my problem-solving skills.

If you know any good courses, books, tutorials, or platforms with Python-based explanations and exercises, please share them. Thank you!

submitted by /u/PretendPiglet7954
[link] [comments]

​r/learnpython Hello everyone! I’m looking for beginner-friendly resources to learn Data Structures and Algorithms (DSA) using Python. My main focus is to build a strong foundation and improve my problem-solving skills. If you know any good courses, books, tutorials, or platforms with Python-based explanations and exercises, please share them. Thank you! submitted by /u/PretendPiglet7954 [link] [comments] 

Hello everyone!

I’m looking for beginner-friendly resources to learn Data Structures and Algorithms (DSA) using Python. My main focus is to build a strong foundation and improve my problem-solving skills.

If you know any good courses, books, tutorials, or platforms with Python-based explanations and exercises, please share them. Thank you!

submitted by /u/PretendPiglet7954
[link] [comments]  Hello everyone! I’m looking for beginner-friendly resources to learn Data Structures and Algorithms (DSA) using Python. My main focus is to build a strong foundation and improve my problem-solving skills. If you know any good courses, books, tutorials, or platforms with Python-based explanations and exercises, please share them. Thank you! submitted by /u/PretendPiglet7954 [link] [comments]

Read more

New to Python and would love some feedback! /u/WonderfulFlan2827 Python Education

New to Python and would love some feedback! /u/WonderfulFlan2827 Python Education

M

Would love some feedback to see if this could be coded differently! I did the original one then had ChatGPT clean it up. I’m not experienced enough to know if it’s good coding. Thanks in advance for the help!

Code starts here

import string

Generate the matrix

matrix = [list(string.ascii_lowercase[i:i + 4]) for i in range(0, 26, 4)] matrix[-1].append(‘!’) # Add ‘!’ to the last row

Define indices

indices = [ (0, 3), (3, 2), (3, 1), (0, 0), (2, 3), (0, 3), None, (4, 3), (4, 1), (5, 0), (3, 0), (3, 3), None, (2, 0), (4, 2), None, (0, 1), (0, 0), (0, 2), (2, 2), (6, 2) ]

Extract result

result = “”.join( ” ” if i is None else matrix[i[0]][i[1]] for i in indices ).upper()

Print the result

print(result)

submitted by /u/WonderfulFlan2827
[link] [comments]

​r/learnpython M Would love some feedback to see if this could be coded differently! I did the original one then had ChatGPT clean it up. I’m not experienced enough to know if it’s good coding. Thanks in advance for the help! Code starts here import string Generate the matrix matrix = [list(string.ascii_lowercase[i:i + 4]) for i in range(0, 26, 4)] matrix[-1].append(‘!’) # Add ‘!’ to the last row Define indices indices = [ (0, 3), (3, 2), (3, 1), (0, 0), (2, 3), (0, 3), None, (4, 3), (4, 1), (5, 0), (3, 0), (3, 3), None, (2, 0), (4, 2), None, (0, 1), (0, 0), (0, 2), (2, 2), (6, 2) ] Extract result result = “”.join( ” ” if i is None else matrix[i[0]][i[1]] for i in indices ).upper() Print the result print(result) submitted by /u/WonderfulFlan2827 [link] [comments] 

M

Would love some feedback to see if this could be coded differently! I did the original one then had ChatGPT clean it up. I’m not experienced enough to know if it’s good coding. Thanks in advance for the help!

Code starts here

import string

Generate the matrix

matrix = [list(string.ascii_lowercase[i:i + 4]) for i in range(0, 26, 4)] matrix[-1].append(‘!’) # Add ‘!’ to the last row

Define indices

indices = [ (0, 3), (3, 2), (3, 1), (0, 0), (2, 3), (0, 3), None, (4, 3), (4, 1), (5, 0), (3, 0), (3, 3), None, (2, 0), (4, 2), None, (0, 1), (0, 0), (0, 2), (2, 2), (6, 2) ]

Extract result

result = “”.join( ” ” if i is None else matrix[i[0]][i[1]] for i in indices ).upper()

Print the result

print(result)

submitted by /u/WonderfulFlan2827
[link] [comments]  M Would love some feedback to see if this could be coded differently! I did the original one then had ChatGPT clean it up. I’m not experienced enough to know if it’s good coding. Thanks in advance for the help! Code starts here import string Generate the matrix matrix = [list(string.ascii_lowercase[i:i + 4]) for i in range(0, 26, 4)] matrix[-1].append(‘!’) # Add ‘!’ to the last row Define indices indices = [ (0, 3), (3, 2), (3, 1), (0, 0), (2, 3), (0, 3), None, (4, 3), (4, 1), (5, 0), (3, 0), (3, 3), None, (2, 0), (4, 2), None, (0, 1), (0, 0), (0, 2), (2, 2), (6, 2) ] Extract result result = “”.join( ” ” if i is None else matrix[i[0]][i[1]] for i in indices ).upper() Print the result print(result) submitted by /u/WonderfulFlan2827 [link] [comments]

Read more

[Help]Sending commands to a specific window, even there are others with the same title. /u/rgdoabc Python Education

[Help]Sending commands to a specific window, even there are others with the same title. /u/rgdoabc Python Education

Hello.

I don’t know much about programming (studied a little 15 years ago) yet I decided to make a little application to help me with a game. Things like sending an entire command in the console with just a key press. I did manage to do it with AHK, but I want to add a UI and other functions in the future and I imagine AHK isn’t going to be good for that.

The first function is getting into a loop until it detects that the game is running. This I managed to do using psutil.

The second part is where I’m lost, because I don’t want to send those commands to another window by accident neither I want to send it when the window isn’t active..

submitted by /u/rgdoabc
[link] [comments]

​r/learnpython Hello. I don’t know much about programming (studied a little 15 years ago) yet I decided to make a little application to help me with a game. Things like sending an entire command in the console with just a key press. I did manage to do it with AHK, but I want to add a UI and other functions in the future and I imagine AHK isn’t going to be good for that. The first function is getting into a loop until it detects that the game is running. This I managed to do using psutil. The second part is where I’m lost, because I don’t want to send those commands to another window by accident neither I want to send it when the window isn’t active.. submitted by /u/rgdoabc [link] [comments] 

Hello.

I don’t know much about programming (studied a little 15 years ago) yet I decided to make a little application to help me with a game. Things like sending an entire command in the console with just a key press. I did manage to do it with AHK, but I want to add a UI and other functions in the future and I imagine AHK isn’t going to be good for that.

The first function is getting into a loop until it detects that the game is running. This I managed to do using psutil.

The second part is where I’m lost, because I don’t want to send those commands to another window by accident neither I want to send it when the window isn’t active..

submitted by /u/rgdoabc
[link] [comments]  Hello. I don’t know much about programming (studied a little 15 years ago) yet I decided to make a little application to help me with a game. Things like sending an entire command in the console with just a key press. I did manage to do it with AHK, but I want to add a UI and other functions in the future and I imagine AHK isn’t going to be good for that. The first function is getting into a loop until it detects that the game is running. This I managed to do using psutil. The second part is where I’m lost, because I don’t want to send those commands to another window by accident neither I want to send it when the window isn’t active.. submitted by /u/rgdoabc [link] [comments]

Read more

How to read file as binary then doing regex search to it /u/metalhorse209 Python Education

How to read file as binary then doing regex search to it /u/metalhorse209 Python Education

This is my code below

import re

hfile1 = open(“example1.so”, “rb”) bfile1 = hfile1.read() hfile1.close()

hfile2 = open(“example2.so”, “rb”) bfile2 = hfile2.read() hfile2.close()

afile1 = re.findall(‘[0-9A-Fa-f]{2}’, bfile1) afile2 = re.findall(‘[0-9A-Fa-f]{2}’, bfile2)

print(afile1)

print(afile2)

and this is error message below

Traceback (most recent call last): File “”, line 12, in <module> afile1 = re.findall(‘[0-9A-Fa-f]{2}’, bfile1) File “”, line 278, in findall return _compile(pattern, flags).findall(string) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

TypeError: cannot use a string pattern on a bytes-like object

How to treat the binary read as string?

submitted by /u/metalhorse209
[link] [comments]

​r/learnpython This is my code below import re hfile1 = open(“example1.so”, “rb”) bfile1 = hfile1.read() hfile1.close() hfile2 = open(“example2.so”, “rb”) bfile2 = hfile2.read() hfile2.close() afile1 = re.findall(‘[0-9A-Fa-f]{2}’, bfile1) afile2 = re.findall(‘[0-9A-Fa-f]{2}’, bfile2) print(afile1) print(afile2) and this is error message below Traceback (most recent call last): File “”, line 12, in <module> afile1 = re.findall(‘[0-9A-Fa-f]{2}’, bfile1) File “”, line 278, in findall return _compile(pattern, flags).findall(string) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ TypeError: cannot use a string pattern on a bytes-like object How to treat the binary read as string? submitted by /u/metalhorse209 [link] [comments] 

This is my code below

import re

hfile1 = open(“example1.so”, “rb”) bfile1 = hfile1.read() hfile1.close()

hfile2 = open(“example2.so”, “rb”) bfile2 = hfile2.read() hfile2.close()

afile1 = re.findall(‘[0-9A-Fa-f]{2}’, bfile1) afile2 = re.findall(‘[0-9A-Fa-f]{2}’, bfile2)

print(afile1)

print(afile2)

and this is error message below

Traceback (most recent call last): File “”, line 12, in <module> afile1 = re.findall(‘[0-9A-Fa-f]{2}’, bfile1) File “”, line 278, in findall return _compile(pattern, flags).findall(string) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

TypeError: cannot use a string pattern on a bytes-like object

How to treat the binary read as string?

submitted by /u/metalhorse209
[link] [comments]  This is my code below import re hfile1 = open(“example1.so”, “rb”) bfile1 = hfile1.read() hfile1.close() hfile2 = open(“example2.so”, “rb”) bfile2 = hfile2.read() hfile2.close() afile1 = re.findall(‘[0-9A-Fa-f]{2}’, bfile1) afile2 = re.findall(‘[0-9A-Fa-f]{2}’, bfile2) print(afile1) print(afile2) and this is error message below Traceback (most recent call last): File “”, line 12, in <module> afile1 = re.findall(‘[0-9A-Fa-f]{2}’, bfile1) File “”, line 278, in findall return _compile(pattern, flags).findall(string) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ TypeError: cannot use a string pattern on a bytes-like object How to treat the binary read as string? submitted by /u/metalhorse209 [link] [comments]

Read more

New to python and need a hand with something I tried making /u/Popular-Spirit1306 Python Education

New to python and need a hand with something I tried making /u/Popular-Spirit1306 Python Education

(Tldr at bottom since this is a ramble)I tried making a simple program to let me know when my internet connection came back online. It was supposed to do a “ping google.com” with a shibang, and if there was no output after 10 seconds, wait 30 seconds and loop again. If it did receive packets, then it would run a “figlet online” in the terminal and exit. Super simple, but I don’t know how to capture or interpret shell output in a python script and it was also not displaying any of the command outputs in my terminal. Sorry if this is rambly Tldr: how do I run shell, capture shell output as a variable, and run commands who’s output is visible in the terminal.

submitted by /u/Popular-Spirit1306
[link] [comments]

​r/learnpython (Tldr at bottom since this is a ramble)I tried making a simple program to let me know when my internet connection came back online. It was supposed to do a “ping google.com” with a shibang, and if there was no output after 10 seconds, wait 30 seconds and loop again. If it did receive packets, then it would run a “figlet online” in the terminal and exit. Super simple, but I don’t know how to capture or interpret shell output in a python script and it was also not displaying any of the command outputs in my terminal. Sorry if this is rambly Tldr: how do I run shell, capture shell output as a variable, and run commands who’s output is visible in the terminal. submitted by /u/Popular-Spirit1306 [link] [comments] 

(Tldr at bottom since this is a ramble)I tried making a simple program to let me know when my internet connection came back online. It was supposed to do a “ping google.com” with a shibang, and if there was no output after 10 seconds, wait 30 seconds and loop again. If it did receive packets, then it would run a “figlet online” in the terminal and exit. Super simple, but I don’t know how to capture or interpret shell output in a python script and it was also not displaying any of the command outputs in my terminal. Sorry if this is rambly Tldr: how do I run shell, capture shell output as a variable, and run commands who’s output is visible in the terminal.

submitted by /u/Popular-Spirit1306
[link] [comments]  (Tldr at bottom since this is a ramble)I tried making a simple program to let me know when my internet connection came back online. It was supposed to do a “ping google.com” with a shibang, and if there was no output after 10 seconds, wait 30 seconds and loop again. If it did receive packets, then it would run a “figlet online” in the terminal and exit. Super simple, but I don’t know how to capture or interpret shell output in a python script and it was also not displaying any of the command outputs in my terminal. Sorry if this is rambly Tldr: how do I run shell, capture shell output as a variable, and run commands who’s output is visible in the terminal. submitted by /u/Popular-Spirit1306 [link] [comments]

Read more