Exemplo n.º 1
0
def get_motor_dataset(filename, start_index=0, end_index=None):
    #    data = pd.DataFrame.from_csv(filename)
    data = pd.read_csv(filename,
                       encoding='utf8',
                       engine='python',
                       error_bad_lines=False)

    # Servo
    servo = []

    # Motor ranges from 40-150
    motor = []

    for i in data.index[start_index:end_index]:
        # Don't want noisy data
        if data['motor'][i] < 40 or data['motor'][i] > 150:
            continue

        if data['servo'][i] < 40 or data['servo'][i] > 150:
            continue

        # Append
        servo.append(raw_to_cnn(data['servo'][i]))
        motor.append(
            raw_to_cnn(data['motor'][i], min_arduino=60.0, max_arduino=90.0))

    return servo, motor
Exemplo n.º 2
0
def get_servo_dataset(filename,
                      start_index=0,
                      end_index=None,
                      conf='/home/ubuntu/settings.json'):
    #    data = pd.DataFrame.from_csv(filename,encoding='utf8')
    data = pd.read_csv(filename,
                       encoding='utf8',
                       engine='python',
                       error_bad_lines=False)

    # Outputs
    x = []

    # Servo ranges from 40-150
    servo = []

    for i in data.index[start_index:end_index]:
        # Don't want noisy data
        #        if data['servo'][i] < 40 or data['servo'][i] > 150:
        #            continue

        # Append
        x.append(deserialize_image(data['image'][i], config=conf))
        servo.append(raw_to_cnn(data['servo'][i]))

    return x, servo
Exemplo n.º 3
0
def get_servo_dataset(filename, start_index=0, end_index=None):
    data = pd.DataFrame.from_csv(filename)

    # Outputs
    x = []

    # Servo ranges from 40-150
    servo = []

    for i in data.index[start_index:end_index]:
        # Don't want noisy data
        if data['servo'][i] < 40 or data['servo'][i] > 150:
            continue

        # Append
        x.append(deserialize_image(data['image'][i]))
        servo.append(raw_to_cnn(data['servo'][i]))

    return x, servo