indexpage

master
giulia 7 years ago
parent 5eaff2a1e5
commit f2d9e1bc38

@ -33,10 +33,10 @@ print "Content-type: text/html"
print ""
print Template(u"""<html>
<head>
<title>RECORD O RAMA</title>
<title>ADOPT A WALK</title>
<style type="text/css">
div.movie {
border: 5px solid pink;
border: 20px solid black;
display: inline-block;
}
div.movie img {
@ -45,15 +45,18 @@ div.movie img {
</style>
</head>
<body>
<body>
<header>
<p>head<p>
<img src="../images/header.png" width="100%"/>
</header>
{% for i in items %}
<div class="movie"><a href="../clips/{{i.mp4}}"><img src="../clips/{{i.jpg}}" /></a> </div>
{% endfor %}
{% for i in items %}
<div class="movie"><a href="../clips/{{i.mp4}}"><img src="../clips/{{i.jpg}}" /></a> </div>
{% endfor %}
<div>
<div>
</div>
</body>
</div>
</body>
</html>""").render(items=items).encode("utf-8")

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

@ -22,7 +22,7 @@ def draw(flow):
f[...,0] = 0 #np.minimum(v*10, 255)
f[...,1] = 0
f[...,2] = 255- np.minimum(v**2, 255) #ang*(180/np.pi/2)
f[...,2] = 255- np.minimum(v**3, 255) #ang*(180/np.pi/2)
bgr = cv2.cvtColor(f, cv2.COLOR_HSV2BGR)
return bgr
@ -35,7 +35,7 @@ p.add_argument("--height", type=int, default=480, help="pre-detect resize height
p.add_argument("--fourcc", default="XVID", help="MJPG,mp4v,XVID")
p.add_argument("--framerate", type=float, default=25, help="output frame rate")
p.add_argument("--show", default=False, action="store_true")
p.add_argument("--time", type=float, default=None)
p.add_argument("--frames", type=int, default=100)
args = p.parse_args()
fourcc = None
@ -59,9 +59,8 @@ while True:
if prevgray.shape == (args.height, args.width):
break
count = 0
try:
if args.time != None:
start = time.time()
while True:
ret, frame = cam.read()
@ -72,18 +71,19 @@ try:
if out != None:
out.write(frame)
count += 1
if args.show:
cv2.imshow('display', frame)
if cv2.waitKey(5) & 0xFF == ord('q'):
break
if args.time != None:
elapsed = time.time() - start
if (elapsed >= args.time):
if args.frames != None:
if (count >= args.frames):
break
except KeyboardInterrupt:
pass
print ("\nCleaning up...")
print ("\nCleaning up... Wrote", count, "frames")
if out:
out.release()
if args.show:

@ -31,6 +31,7 @@ if args.output:
else:
out = None
count=0
try:
if args.time != None:
start = time.time()
@ -38,6 +39,7 @@ try:
ret, frame = cam.read()
if out != None:
out.write(frame)
count += 1
if args.show:
cv2.imshow('display', frame)
if cv2.waitKey(5) & 0xFF == ord('q'):
@ -50,7 +52,7 @@ try:
except KeyboardInterrupt:
pass
print ("\nCleaning up...")
print ("\nCleaning up... Wrote", count, "frames")
if out:
out.release()
if args.show:

@ -3,31 +3,85 @@ espeak "Gait analysis number one." -v en
sleep 1
espeak "Please state your name:" -v en
sleep 1
espeak "Position yourself 2 to 3 meters away from the Tetra Gamma Circulaire." -v en
sleep 2
espeak "Walk towards the Tetra Gamma Circulaire in a straight line ." -v en
sleep 0.2
play sweep_up.wav
basename=clips/$(date +%Y-%m-%d-%H-%M-%S)
echo recording $basename.avi...
scripts/black2.py --output $basename.avi --time 3
scripts/black2.py --output $basename.avi --frames 50 --framerate 4 --width 320 --height 240
# convert to mp4
ffmpeg -i $basename.avi -y $basename.mp4
# make a thumnail image
ffmpeg -i $basename.avi -vframes 1 -ss 0.5 -y $basename.jpg
rm $basename.avi
# rm $basename.avi
espeak "ciao ciao halo" -v en
sleep 2
play sweep_up.wav
espeak "Position yourself one meter away to the left of the Tetra Gamma Circulaire." -v en
sleep 1
espeak "Walk from left to right in front of the Tetra Gamma Circulaire.
" -v en
sleep 0.2
play sweep_up.wav
basename=clips/$(date +%Y-%m-%d-%H-%M-%S)
echo recording $basename.avi...
scripts/black2.py --output $basename.avi --frames 50 --framerate 4 --width 320 --height 240
# convert to mp4
ffmpeg -i $basename.avi -y $basename.mp4
# make a thumnail image
ffmpeg -i $basename.avi -vframes 1 -ss 0.5 -y $basename.jpg
# rm $basename.avi
play sweep_up.wav
espeak "Turn your back to the Tetra Gamma Circulaire." -v en
sleep 1
espeak "Walk away from the Tetra Gamma Circulaire.
" -v en
sleep 0.2
play sweep_up.wav
basename=clips/$(date +%Y-%m-%d-%H-%M-%S)
echo recording $basename.avi...
scripts/black2.py --output $basename.avi --time 3
scripts/black2.py --output $basename.avi --frames 50 --framerate 4 --width 320 --height 240
# convert to mp4
ffmpeg -i $basename.avi -y $basename.mp4
# make a thumnail image
ffmpeg -i $basename.avi -vframes 1 -ss 0.5 -y $basename.jpg
rm $basename.avi
# rm $basename.avi
play sweep_up.wav
espeak "Position yourself 2 to 3 meters away from the Tetra Gamma Circulaire." -v en
sleep 1
espeak "Walk towards the Tetra Gamma Circulaire on a zig zag line.
" -v en
sleep 0.2
play sweep_up.wav
basename=clips/$(date +%Y-%m-%d-%H-%M-%S)
echo recording $basename.avi...
scripts/black2.py --output $basename.avi --frames 50 --framerate 4 --width 320 --height 240
# convert to mp4
ffmpeg -i $basename.avi -y $basename.mp4
# make a thumnail image
ffmpeg -i $basename.avi -vframes 1 -ss 0.5 -y $basename.jpg
# rm $basename.avi
play sweep_up.wav
# subprocess.call(["espeak", "Please state your name:", "-v", "en"])
# sleep(2)

Binary file not shown.
Loading…
Cancel
Save