Created
February 3, 2018 03:19
-
-
Save minakhan01/e1117a090f7f9fc9d620350004a26db7 to your computer and use it in GitHub Desktop.
wifi_cam.py
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
import picamera | |
from time import sleep | |
import urllib2 | |
import urllib | |
import requests | |
camera = picamera.PiCamera() | |
# query_args = { 'RPI':'Active' } | |
url = 'http://165.227.116:5000/predict' | |
# data = urllib.urlencode(query_args) | |
# request = urllib2.Request(url, data) | |
while True: | |
camera.capture('image.jpg') | |
files = {'image': open('image.jpg', 'rb')} | |
request = requests.post(url, files=files) | |
response = request.content | |
print response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment