Skip to content

Instantly share code, notes, and snippets.

@shubham0204
Created June 22, 2022 12:18
Show Gist options
  • Save shubham0204/8a2a21a20e6ec4b82804cf665adf06b6 to your computer and use it in GitHub Desktop.
Save shubham0204/8a2a21a20e6ec4b82804cf665adf06b6 to your computer and use it in GitHub Desktop.
while True:
# Request the image from the server
response = requests.get(url="http://<network_ip_address>:<port>/photo.jpg")
imgNp = np.array(bytearray(response.content), dtype=np.uint8)
frame = cv2.imdecode(imgNp, cv2.IMREAD_UNCHANGED )
# As OpenCV decodes images in BGR format, we'd convert it to the RGB format
frame = cv2.cvtColor( frame , cv2.COLOR_BGR2RGB )
frame_window.image(frame)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment