Пример #1
0
from Net.tensor import tensornet, net2
from pipeline.bincam import BinaryCamera
from options import Options
import cv2
import numpy as np
bc = BinaryCamera('./meta.txt')
bc.open()

options = Options()
options.show = True
options.record = False

tfnet = net2.NetTwo()
sess = tfnet.load(var_path=options.tf_dir + 'net2/net2_01-21-2016_02h14m08s.ckpt')
im = bc.read_binary_frame(show=options.show, record=False)
im = np.reshape(im, (125, 125, 1))
print(tfnet.output(sess, im))
sess.close()
sess = tfnet.load(var_path=options.tf_dir + 'net2/net2_01-21-2016_02h14m08s.ckpt')
print(tfnet.output(sess, im))
sess.close()
Пример #2
0
"""

from gripper.TurnTableControl import *
from gripper.PyControl import *
from gripper.xboxController import *

from pipeline.bincam import BinaryCamera
from options import Options

import time
import argparse

ap = argparse.ArgumentParser()
ap.add_argument('-s', '--show', required=False, action='store_true')
args = vars(ap.parse_args())

bincam = BinaryCamera('./meta.txt')
bincam.open()

options = Options()
options.show = args['show']
options.record = False

c = XboxController([
    options.scales[0], 155, options.scales[1], 155, options.scales[2],
    options.scales[3]
])

while True:
    print c.getUpdates()
Пример #3
0
from pipeline.bincam import BinaryCamera
import cv2
import time
from options import Options
from Net.tensor import inputdata

bc = BinaryCamera("./meta.txt")
bc.open()
frame = bc.read_frame()
frames = []
fourcc = cv2.cv.CV_FOURCC(*'mp4v')

writer = cv2.VideoWriter("hardware_reset.mov", fourcc, 10.0, (420,420))
try:
    while True:
	    frame = bc.read_frame()
	    frame = inputdata.im2tensor(frame, channels=3)
	    cv2.imshow("camera",frame)

	    cv2.waitKey(30)

	    
	    frames.append(frame)
	    #time.sleep(0.08)
	    
except KeyboardInterrupt:
    pass
    
#for frame in frames:
#   writer.write(frame)
#writer.release()