Hi there. I have a suggestion regarding this project. You can set a server that will run that python script, and the user of the extension will be sending the stream back to the server, a server does the logic, and comes back to the user with results.
However, using this method will require you to find a server that will receive those calls from the extension user ie. that will host that python script over there. Also, there might be some lag in the process.
Anyway, feel free to hit me up so we can talk more about this. I am very responsive. All the best