Пример #1
0
def run_samples(n):
    net = net6_c.NetSix_C()
    path = '/media/1tb/Izzy/nets/net6_05-11-2016_12h09m12s.ckpt'
    sess = net.load(path)

    bc = BinaryCamera('./meta.txt')
    bc.open()
    for i in range(4):
        bc.read_frame()    


    num_samples = n
    samples = []
    images = []
    for i in range(num_samples):
        print i
        try:
            while True:
                frame = bc.read_frame()
                frame = inputdata.im2tensor(frame, channels=3)
                cv2.imshow('preview', frame)
                cv2.waitKey(30)            
        except:
            pass
        frame = bc.read_frame()
        frame = similarity.color(frame)
        images.append(frame)
        print "Saved sample"    
        np.save('samples_images.npy', images)
Пример #2
0
from gripper.TurnTableControl import *
from gripper.PyControl import *
from gripper.xboxController import *

from pipeline.bincam import BinaryCamera
from options import Options
from lfd import LFD

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

t = TurnTableControl(
)  # the com number may need to be changed. Default of com7 is used
izzy = PyControl(115200, .04, [0, 0, 0, 0, 0], [0, 0, 0])
# same with this
c = XboxController([
    options.scales[0], 155, options.scales[1], 155, options.scales[2],
    options.scales[3]
])

izzy.stop()
Пример #3
0
from pipeline.bincam import BinaryCamera
import cv2
import time
import numpy as np
from Net.tensor import inputdata
from edgeRICam import getTemplates, processFrame, findInitialMatch, traceObj, updateMatch

bc = BinaryCamera("./meta.txt")
bc.open()
frame = bc.read_frame()
#store processed templates; list of lists with various rotations of each template
filtTemplates = getTemplates()
sampleTemps = filtTemplates[0]
filtFrame = processFrame(frame)
pos, foundTemp = findInitialMatch(filtFrame, sampleTemps)
out = traceObj(frame, pos, foundTemp)
cv2.imshow("camera", out)
print("initial match found- press any key to begin")
cv2.waitKey(5000)
try:
	while True:
	    frame = bc.read_frame()
	    filtFrame = processFrame(frame)
        pos, foundTemp = updateMatch(pos, frame, sampleTemps)
        out = traceObj(frame, pos, foundTemp)
        cv2.imshow("camera",out)
        cv2.waitKey(250)
except KeyboardInterrupt:
    pass
Пример #4
0
Comment or uncomment "options.record = True"
"""

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

from pipeline.bincam import BinaryCamera
from options import Options
from lfd import LFD

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

t = TurnTableControl() # the com number may need to be changed. Default of com7 is used
izzy = PyControl(115200, .04, [0,0,0,0,0],[0,0,0]); # same with this
c = XboxController([options.scales[0],155,options.scales[1],155,options.scales[2],options.scales[3]])

izzy.stop()
#izzy.gotoState(None, .1, None, None, None, None])
Пример #5
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()