Created
June 22, 2022 12:18
-
-
Save shubham0204/8a2a21a20e6ec4b82804cf665adf06b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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