Tested in Ubuntu 16.04 (test machine has GPUs. may need some modification if have no GPU)
cd ~/
git clone -b sim https://github.com/commaai/openpilot.git
Tested in Ubuntu 16.04 (test machine has GPUs. may need some modification if have no GPU)
cd ~/
git clone -b sim https://github.com/commaai/openpilot.git
| import os | |
| import urllib | |
| def data_check(file_name, data_dir='', base_url='https://s3.amazonaws.com/nyc-tlc/trip+data/'): | |
| """ | |
| 1. check if the given {file_name} exists locally in {data_dir} | |
| 2. download from {base_url} & save in {data_dir) if not | |
| INPUTS | |
| > file_name |
| import pynvml | |
| pynvml.nvmlInit() | |
| handle = pynvml.nvmlDeviceGetHandleByIndex(0) | |
| device_name = pynvml.nvmlDeviceGetName(handle) | |
| if (device_name != b'Tesla T4') and (device_name != b'Tesla P4') and (device_name != b'Tesla P100-PCIE-16GB'): | |
| raise Exception(""" | |
| Unfortunately this instance does not have a T4, P4 or P100 GPU.\n | |
| Please make sure you've configured Colab to request a GPU instance type.\n |
| # folder where the image is already saved (without bounding boxes) | |
| data_dir = 'media/stable_numbers/number_crops/' | |
| # folder where the new image with bounding boxes should be saved | |
| out_dir = 'media/copy_labeled_number_crops/' | |
| # go through the unique file names (because files can have more than 1 bounding box) | |
| for file in new_df.filename.unique(): | |
| # load in the image and .loc[] the rows where it's referenced (each row represents 1 bounding box) |