Skip to content

Instantly share code, notes, and snippets.

Takashi Kaneda kndt84

Block or report user

Report or block kndt84

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kndt84
kndt84 / Dockerfile
Last active Mar 25, 2020
Docker file of OpenVINO™ toolkit 2020 R1
View Dockerfile
FROM ubuntu:18.04
USER root
ENV INSTALLDIR /opt/intel/openvino
ARG DOWNLOAD_LINK=http://registrationcenter-download.intel.com/akdlm/irc_nas/16345/l_openvino_toolkit_p_2020.1.023.tgz
WORKDIR /
RUN useradd -ms /bin/bash openvino && \
chown openvino -R /home/openvino
View dockerexec.sh
#!/bin/sh
for var in video0_2018-10-18 video0_2018-10-19 video0_2018-10-20 video0_2018-10-21 video0_2018-10-22
do
docker run --runtime=nvidia --rm -v /mnt:/data sensevideo /opt/algorithm/build/cli --input /data/src/${var}.mp4 --output /data/dst/${var}.mp4 --log /data/dst/${var}.txt &
done
@kndt84
kndt84 / concat.sh
Last active Oct 17, 2019
Concat movie files with ffmpeg
View concat.sh
#!/bin/bash
EXT=$1
OUTFILENAME=$2
TXTFILE=filelist.txt
ls -d ./*.${EXT} | sed 's/^/file /' > $TXTFILE
ffmpeg -f concat -safe 0 -i $TXTFILE -c copy ../$2 > /dev/null 2>&1 </dev/null
View extract_red_contours.py
#!/usr/local/bin/python3
import glob
import numpy as np
import cv2
import sys
import os
import shutil
label='Ossicle'
@kndt84
kndt84 / setup.sh
Last active Mar 30, 2018
Setting Up NVIDIA Docker with Ubuntu 16.04
View setup.sh
# Install CUDA Toolkit 9.1 including NVIDIA Driver
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
# Install Docker CE
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
@kndt84
kndt84 / mobilenetv2.prototxt
Last active Mar 4, 2018
MobileNet V2 caffe implementation for NVIDIA DIGITS
View mobilenetv2.prototxt
name: "MOBILENET_V2"
layer {
name: "train-data"
type: "Data"
top: "data"
top: "label"
transform_param {
mirror: true
crop_size: 224
}
@kndt84
kndt84 / mobilenet.prototxt
Last active Mar 4, 2018
MobileNet caffe implementation for NVIDIA DIGITS
View mobilenet.prototxt
name: "MOBILENET"
layer {
name: "train-data"
type: "Data"
top: "data"
top: "label"
transform_param {
mirror: true
crop_size: 224
}
View image_agumentation.py
import os
import glob
from PIL import Image, ImageOps
path_list = glob.glob('*.png')
for path in path_list:
filename, ext = os.path.splitext( os.path.basename(path) )
im = Image.open(path)
@kndt84
kndt84 / intersection.cpp
Last active Oct 14, 2017
C++ function which tests whether two lines are intersected
View intersection.cpp
int intersection(Point2i p1, Point2i p2, Point2i p3, Point2i p4) {
// Store the values for fast access and easy
// equations-to-code conversion
int x1 = p1.x, x2 = p2.x, x3 = p3.x, x4 = p4.x;
int y1 = p1.y, y2 = p2.y, y3 = p3.y, y4 = p4.y;
int d = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
// If d is zero, there is no intersection
if (d == 0) return 0;
@kndt84
kndt84 / add_unixtime.py
Last active Aug 4, 2017
Add unixtime to first column
View add_unixtime.py
#!/usr/bin/python
import csv
import sys
import re
fps=10
filename=sys.argv[1]
start_unixtime=int(re.search(r'(\d+)\.txt', filename).group(1))
You can’t perform that action at this time.