Skip to content

Instantly share code, notes, and snippets.

Avatar

Taras jackersson

View GitHub Profile
View gstreamer_python_installation_output
---> pip install -U git+https://github.com/jackersson/gstreamer-python.git#egg=gstreamer-python -v
Created temporary directory: /tmp/pip-ephem-wheel-cache-3ym3nc1k
Created temporary directory: /tmp/pip-req-tracker-2clwxc17
Created requirements tracker '/tmp/pip-req-tracker-2clwxc17'
Created temporary directory: /tmp/pip-install-kwa_32rt
Collecting gstreamer-python
Cloning https://github.com/jackersson/gstreamer-python.git to /tmp/pip-install-kwa_32rt/gstreamer-python
Running command git clone -q https://github.com/jackersson/gstreamer-python.git /tmp/pip-install-kwa_32rt/gstreamer-python
Added gstreamer-python from git+https://github.com/jackersson/gstreamer-python.git#egg=gstreamer-python to build tracker '/tmp/pip-req-tracker-2clwxc17'
@jackersson
jackersson / Dockerfile
Last active Jan 23, 2021
Gstreamer-1.0-Ubuntu-18-Docker-Installation
View Dockerfile
FROM ubuntu:18.04
USER root
RUN apt-get update && apt-get -y --no-install-recommends install \
sudo \
vim \
wget \
build-essential \
pkg-config
@jackersson
jackersson / Dockerfile
Last active Mar 25, 2020
Gstreamer-1.0+Python3.6-Ubuntu-18-Docker-Installation
View Dockerfile
FROM ubuntu:18.04
USER root
RUN apt-get update && apt-get -y --no-install-recommends install \
sudo \
vim \
wget \
build-essential \
pkg-config \
View test_mlflow.py
import mlflow # import log_metric, log_param, log_artifact
# https://www.youtube.com/watch?v=wb-ZxtIwSTA
def exp(metric, param):
mlflow.set_tracking_uri("http://mlflow:NJKbe21jk4e1@ec2-18-184-150-238.eu-central-1.compute.amazonaws.com/")
exp_name = "smart-counter"
mlflow.set_experiment(exp_name)
with mlflow.start_run(nested=True):
mlflow.log_param("param1", param)
View install_gst_req.sh
sudo apt-get install --no-install-recommends -y \
build-essential pkg-config git \
sudo apt-get install --no-install-recommends -y \
gstreamer-1.0 gstreamer1.0-dev \
gstreamer1.0-tools \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav \
@jackersson
jackersson / install_pygst.sh
Last active Nov 12, 2019
install_pygst.sh
View install_pygst.sh
# After PyGObject (https://lazka.github.io/pgi-docs/) installed
# > pip install PyGObject
# Run current script to override Gstreamer related Scripts
LIBPYTHONPATH=""
PYTHON=/usr/bin/python3
GST_VERSION=1.14.1
View tf_model_stats
import os
import tensorflow as tf
from spyglass.model import model_loader
from sales_zone.tf_models import ObjectDetector
def get_model_flops(model_cls, model_config: dict):
with model_loader(model_cls,
model_config=model_config) as model:
graph = model._session.graph
View color_picker.py
class ColorPicker:
def __init__(self, channels: int = 4):
self._color_by_id = {}
self._channels = channels
def get(self, idx):
if idx not in self._color_by_id:
self._color_by_id[idx] = self._generate_color(channels=self._channels)
View metadata_format.json
{
"frame_offset": 1,
"track_id": 1,
"group_id": 1,
"identity": {
"name": "First-Last Name",
"confidence": 0.9
},
View gist:610ee14e3c4076146b19e58f70dec635
Gst-Pipelines
1: filesrc location=video.mp4 ! qtdemux ! h264parse ! avdec_h264 ! videoconvert n-threads=0 ! video/x-raw,format=RGB,width=1920,height=1080 ! appsink emit-signals=True sync=false
2: appsrc caps=video/x-raw,format=RGB,width=1920,height=1080 emit-signals=True is-live=true ! videoconvert ! x264enc tune=zerolatency ! mp4mux ! filesink location=1.mp4 sync=false
Getting an error:
> gst_segment_to_running_time: assertion 'segment->format == format' failed