Skip to content

Instantly share code, notes, and snippets.

View shangliy's full-sized avatar
🎯
Focusing

shangliy

🎯
Focusing
View GitHub Profile
import numpy as np
import cv2
cap = cv2.VideoCapture('vtest.avi')
while(cap.isOpened()):
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
@shangliy
shangliy / test_python.py
Created September 20, 2019 02:32
python test scripts #python #samlpe
"""
This is the test script;
"""
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import sys
sys.path.append('.')
import unittest
@shangliy
shangliy / extractor.py
Created September 18, 2019 17:01
Python Multithread
def extract_features_multiple(images_list, detector, extractor, workers=8):
"""This is a function to extract features from multiple images in multithreads way"""
feature_hash = dict()
with ThreadPoolExecutor(max_workers=workers) as executor:
futures = [executor.submit(extract_feature_one, x, detector, extractor) for x in images_list]
for task in concurrent.futures.as_completed(futures):
r = task.result()
if r[0]:
feature_hash[r[1]] = r[2]
return feature_hash
@shangliy
shangliy / README-Template.md
Created June 7, 2019 03:23 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Advanced Lane Finding

Udacity - Self-Driving Car NanoDegree

This project is to use advanced technologies to solve lane detection problem.

Detail

Image/Frame Processing:

The steps of this project are the following:

  1. Compute the camera calibration matrix and distortion coefficients given a set of chessboard images. The images for camera calibration are stored in the folder called camera_cal. Then I save the amera calibration matrix [mtx] and distortion coefficients [dist] to a pickle file wide_dist_pickle.p