13 comments on “Computer Vision on the Web with WebRTC and TensorFlow

    • Please do share! My hack here certainly wouldn’t scale well into a service, but the situation should dramatically with a proper GPU setup.

      I have another set of posts coming soon applying a similar technique to an embedded device too.

  1. Pingback: Live Body-Context (063) – Another Idea

  2. Thanks for the very detailed write-up!

    Just to be complete, if you want to process an actual video stream (as opposed to capturing individual images and sending them using an XHR), you could make use of an RTCPeerConnection. On the server side you can make use of “aiortc”, a Python implementation of WebRTC. You can then grab whatever frames you want, apply image processing and even return the results as a video stream.

  3. Thanks for this incredible work, unfortunately I have a problem and I have not been able to solve it, I am using windows 10 and at the moment of executing the service it throws me the following error

    TypeError: Object of type ‘int32’ is not JSON serializable

    Any idea what it could be?

    • You are seeing this in the Python console output?

      I’m not sure why you are getting an error – I ran mine on Win10 and OSX. Offhand the only piece of the output JSON that is an integer is line 106 of the object_detection_apy.py: item.numObjects = obj_above_thresh. You could try to convert that to a string with str() or something like it to see if that works (or just remove that line).

      If you still have trouble please open an issue in the github repo where others are more likely to see it: https://github.com/webrtcHacks/tfObjWebrtc/issues

      • Yes is in the console, the probles seems come form File “D:\web\tfObjWebrtc\object_detection_api.py”, line 126, in get_objects
        outputJson = json.dumps([ob.__dict__ for ob in output])

Leave a Reply

Your email address will not be published. Required fields are marked *