This file contains hidden or 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 | |
import depthai as dai | |
pipeline = dai.Pipeline() | |
cam = pipeline.create(dai.node.ColorCamera) | |
cam.setCamera("color") | |
cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P) | |
manip = pipeline.create(dai.node.ImageManip) |
This file contains hidden or 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
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI | |
on: push | |
jobs: | |
build-n-publish: | |
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python 3.10 |
This file contains hidden or 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 json | |
from aiohttp import web | |
from aiortc import RTCPeerConnection, RTCSessionDescription | |
import traceback | |
import numpy as np | |
from aiortc import VideoStreamTrack | |
import cv2 | |
from av import VideoFrame | |
import depthai as dai | |
import blobconverter |
This file contains hidden or 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
# For more options and information see | |
# http://rpf.io/configtxt | |
# Some settings may impact device functionality. See link above for details | |
# uncomment if you get no picture on HDMI for a default "safe" mode | |
#hdmi_safe=1 | |
# uncomment this if your display has a black border of unused pixels visible | |
# and your display can output without overscan | |
#disable_overscan=1 |
This file contains hidden or 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 ubuntu:18.04 | |
RUN apt update && apt install -y software-properties-common | |
RUN add-apt-repository ppa:deadsnakes/ppa | |
RUN apt update | |
RUN apt install -y python3.8 curl python3-distutils python3-apt libgl1-mesa-glx libpulse-dev libxcb-xinerama0 libfontconfig libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xfixes0 libxcb-xkb1 libxkbcommon-x11-0 | |
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | |
RUN python3.8 get-pip.py | |
RUN python3.8 -m pip install --extra-index-url https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/ depthai-gui | |
CMD depthai-gui |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
apt-get update | |
apt-get install -y python3 python3-pip udev | |
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | tee /etc/udev/rules.d/80-movidius.rules | |
udevadm control --reload-rules && sudo udevadm trigger | |
# https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html | |
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev | |
# https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo |
This file contains hidden or 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 | |
VIDEO_WRITER_FOURCC = "H264" | |
class Writer: | |
""" | |
Usage: | |
writer = Writer("myvideofile.mp4") | |
for frame in <source>: |
This file contains hidden or 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
#!/bin/bash | |
if [[ $(pwd) != *"depthai" ]]; then | |
echo "You need to run this script from the cloned depthai repository (you can clone it from here - https://github.com/luxonis/depthai)" | |
exit 1 | |
fi | |
echo "Installing required tools for the debug script..." | |
sudo apt-get install util-linux usbutils lshw coreutils |
This file contains hidden or 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
#!/usr/bin/env python3 | |
from flask import Flask, jsonify, request | |
app = Flask(__name__) | |
people_count = 0 | |
@app.route("/increase/", methods=['POST']) | |
def run(): |
This file contains hidden or 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 multiprocessing import Pipe, Process | |
def _thread_fun(pipe: Pipe): | |
while True: | |
print('WAITING') | |
val = pipe.recv() | |
if val == 'FINISH': | |
print('FINISHING') | |
break | |
pipe.send(val * 10) |
NewerOlder