This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
camera = cv2.VideoCapture(0) # use 0 for web camera | |
# for cctv camera'rtsp://username:password@ip_address:554/user=username_password='password'_channel=channel_number_stream=0.sdp' | |
def camera_stream(): | |
while True: | |
# Capture frame-by-frame | |
success, frame = camera.read() | |
if not success: | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (navigator.getUserMedia) { // navigator.getUserMedia pass three arguments | |
navigator.getUserMedia({video: true}, //if want audio can be true | |
stream => { | |
let camera = document.getElementById('camera'); //class or id for load stream on html | |
camera.srcObject = stream; //src of stream | |
camera.onloadedmetadata = () => { | |
camera.play(); | |
} | |
}, err => { | |
console.log(err) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a host for your project | |
- Do not need run 'php artisan serve' anymore in your laravel project. | |
# 1. Go to linux terminal and type | |
```php | |
cd /etc/apache2/sites-available | |
``` | |
# 2. Now create a file name like | |
```php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
SAVE_DIR = os.path.dirname(os.path.abspath(__file__)) | |
def base64_to_image(filename): | |
path = os.path.join(SAVE_DIR, 'images/') | |
if not os.path.isdir(path): | |
os.mkdir(path) | |
data = base64.b64decode(filename) | |
filename = 'frame' + str(datetime.datetime.now().microsecond) + '.jpg' | |
destination = "/".join([path, filename]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.7.0rc2/protoc-3.7.0-rc-2-linux-x86_64.zip | |
# Unzip | |
unzip protoc-3.7.0-rc-2-linux-x86_64.zip -d protoc3 | |
# Move protoc to /usr/local/bin/ | |
sudo mv protoc3/bin/* /usr/local/bin/ | |
# Move protoc3/include to /usr/local/include/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add those in bashrc | |
export GOROOT=/usr/local/go | |
export GOPATH=$HOME/go | |
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from distutils.core import setup | |
from distutils.extension import Extension | |
from Cython.Distutils import build_ext | |
from Cython.Build import cythonize | |
ext_modules = [ | |
Extension("test", ["test.py"]), | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongoexport --db meghna --collection recognitions --out recognitions.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from alpine:latest | |
RUN apk add --no-cache python3-dev \ | |
&& pip3 install --upgrade pip | |
WORKDIR /app | |
COPY . /app | |
RUN pip3 --no-cache-dir install -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const options = { | |
year: 'numeric', | |
month: 'numeric', | |
day: 'numeric', | |
hour: 'numeric', | |
minute: 'numeric', | |
second: 'numeric' | |
} | |
new Intl.DateTimeFormat('en-US', options).format(date) //"7/22/2018, 7:22:13 AM" |
OlderNewer