Ejemplo n.º 1
0
import atexit
import csv
import signal
#import logging
sys.path.append(dirname(dirname(os.path.realpath(__file__))))

import cv2
import numpy as np
import pygame
import pyping

from robocar42 import config, util, models
from robocar42.car import Car
from robocar42.display import Display

logger = util.configure_log('drive')

NUM_CLASSES = 4
delta_time = 750
conf_level = 0.3

rc_car = Car(config.vehicle_parser_config(
    'vehicle.ini'))  # parses values from vehicle.ini into an object Car
disp_conf = config.display_parser_config(
    'display.ini')  # parses values from display.ini
cam_1 = config.camera_parser_config(
    'camera_1.ini')  # parses values from camera_1.ini
cam_2 = config.camera_parser_config(
    'camera_2.ini')  # parses values from camera_2.ini
model_conf = config.model_parser_config(
    'model_1.ini')  # sets values from model_1.ini
Ejemplo n.º 2
0
import csv
import time
import argparse

import logging
sys.path.append(dirname(dirname(os.path.realpath(__file__))))

import numpy as np  # needed?
import cv2
import pandas as pd  # needed?

from robocar42 import util
from robocar42 import config
from robocar42 import preprocess

logger = util.configure_log(
    'preprocess')  # set the logger name for this script

op_list = [('darken', preprocess.darken), ('brighten', preprocess.brighten),
           ('flip', preprocess.flip)]

reverse = [0, 2, 1, 3]


def build_parser():
    '''
    Build Parser
    '''
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '-sim_cutoff',  # argument for similarity threshold, type=float default 0.1
        type=float,
Ejemplo n.º 3
0
import csv
import time
import argparse

import logging
sys.path.append(dirname(dirname(os.path.realpath(__file__))))

import numpy as np
import cv2
import pandas as pd

from robocar42 import util
from robocar42 import config
from robocar42 import preprocess

logger = util.configure_log('preprocess')

op_list = [('darken', preprocess.darken), ('brighten', preprocess.brighten),
           ('flip', preprocess.flip)]

reverse = [0, 2, 1, 3]


def build_parser():
    '''
    Build Parser
    '''
    parser = argparse.ArgumentParser()
    parser.add_argument('-sim_cutoff',
                        type=float,
                        help="Image similarity threshold. Default: 0.1",
Ejemplo n.º 4
0
import os
from os.path import dirname
from os.path import basename
import time
import zipfile
import signal
sys.path.append(dirname(dirname(os.path.realpath(__file__))))

from google.cloud import storage
from google.cloud import datastore

from robocar42 import util
from robocar42.util import progress_bar
from robocar42 import config

logger = util.configure_log('staging')


def get_staging():
    '''
    Gets the list of files under the staging folder
    '''
    cloud_conf = config.cloud_parser_config('cloud.ini')
    print(cloud_conf)
    client = storage.Client()
    print(client)
    bucket = client.get_bucket(cloud_conf['bucket'])
    folder = cloud_conf['folder'] + '/'
    blobs = list(bucket.list_blobs(prefix=folder, delimiter='/'))
    return blobs
Ejemplo n.º 5
0
import re
from os.path import dirname
from os.path import basename
import csv
import argparse
import shutil

import logging
sys.path.append(dirname(dirname(os.path.realpath(__file__))))

import pandas as pd

from robocar42 import util
from robocar42 import config

logger = util.configure_log('data_manage')


def build_parser():
    '''
    returns the parsed data sets and name of output
    '''
    parser = argparse.ArgumentParser()  # set parser
    parser.add_argument(  # parses out set names (set1 + set2 + ...)
        'datasets',
        nargs='+',  # deliniator '+'
        type=str,
        help='List of datasets to put together')
    parser.add_argument('outset', type=str, help='Name of output dataset')
    return parser
Ejemplo n.º 6
0
'''This module describes the Display class which camera frames.'''

import os
import sys
import time
from threading import Thread
sys.path.append('..')

import pygame

from robocar42 import config, camera, util
from robocar42.CustomException import DisplayError

logger = util.configure_log('display')


class Display(object):
    '''
    Display object class
    '''
    def __init__(self, name, disp_conf, cam_confs, cam_num=2):
        '''
        Init function for Display
        '''
        if cam_num < 0 or not cam_confs:
            raise DisplayError("Display object has no cameras to instantiate.")
        self.cam_list = []
        for i in range(cam_num):
            cam_conf = config.camera_parser_config(cam_confs[i])
            cam = camera.Camera('cam_' + str(i + 1), cam_conf)
            self.cam_list.append(cam)