Commit e0d89a71 authored by Michael Murtaugh's avatar Michael Murtaugh

rsync script for media

parent 26da1679
......@@ -19,7 +19,10 @@ def post (image, face, url="http://localhost:8000/post/"):
if hinput.attrib.get("name") == "csrfmiddlewaretoken":
data['csrfmiddlewaretoken'] = hinput.attrib.get("value")
# face=>data
data['classification_data'] = json.dumps(face_to_dict(face))
if face:
data['classification_data'] = json.dumps(face_to_dict(face))
else:
data['classification_data'] = '{}'
print ("pre-post check url", url)
print ("pre-post check data", data)
print ("pre-post check files", files)
......
......@@ -75,3 +75,31 @@ def print_photostrip(data):
#p.image("qr.test.png")
# p.barcode('1324354657687','EAN13',64,2,'','')
#p.cut()
def print_image (path, rotate):
try:
p = Usb(USB1,USB2,0)
if path.startswith("http"):
f = urlopen(i['image'])
im = Image.open(f)
else:
im = Image.open(path)
if rotate:
im = im.rotate(90)
p.image(im)
p.cut()
return True
except USBNotFoundError:
return False
if __name__ == "__main__":
import argparse
ap = argparse.ArgumentParser("")
ap.add_argument("--rotate", action="store_true", default=False)
ap.add_argument("path", nargs="+")
args = ap.parse_args()
for n in args.path:
print_image(n, rotate=args.rotate)
\ No newline at end of file
......@@ -117,8 +117,8 @@ while True:
# _, imagedata = cv2.imencode(".jpg", current_image)
# rescode = post.post(imagedata, face, args.post)
rescode = post.post(image_fname, face, args.post)
print (u"post result {0}\n{1}".format(rescode, rescode.text).encode("utf-8"), file=sys.stderr)
rdata = json.loads(rescode.text)
# print (u"post result {0}\n{1}".format(rescode, rescode.text).encode("utf-8"), file=sys.stderr)
print (u"post result", rdata, file=sys.stderr)
print_photostrip(rdata)
# os.system("/home/pi/projects/")
......
rsync -avz -e ssh recognitionmachine:public_html/media/photos media/photos/
......@@ -75,3 +75,22 @@ Ads tab
Examples
Kodak film + racism
Facial Recognition: Fag Face
Final Documentation
=======================
Group 3: login: RecognitionMachine - pwd: whoami
Discoveries
The Printer works very well to create a situation --- excitement to use, the pacing of the automatic portrait / classify / print loop is strong ... no one is looking
Adjusting your face
Video inside...
Watching the search
Lichtbak / guidelines on the outside (dataset)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment