Skip to content

Instantly share code, notes, and snippets.

View thejasonfisher's full-sized avatar

Jason Fisher thejasonfisher

View GitHub Profile
@gsoykan
gsoykan / tensor_2_cv2.py
Created March 10, 2023 19:23
pt tensor to cv2 image
import cv2
import numpy as np
import torch
# Create a random torch tensor
tensor = torch.randn(3, 256, 256)
# Convert the tensor to a numpy array
numpy_image = tensor.numpy()
@thejasonfisher
thejasonfisher / pytorch-glumpy.py
Created February 26, 2023 03:31 — forked from victor-shepardson/pytorch-glumpy.py
using pycuda and glumpy to draw pytorch GPU tensors to the screen without copying to host memory
from contextlib import contextmanager
import numpy as np
import torch
from torch import Tensor, ByteTensor
import torch.nn.functional as F
from torch.autograd import Variable
import pycuda.driver
from pycuda.gl import graphics_map_flags
from glumpy import app, gloo, gl
@bharath5673
bharath5673 / deepstream 6.1_ubuntu20.04 installation.md
Last active April 6, 2024 13:38
NVIDIA DeepStream SDK 6.1 / 6.0.1 / 6.0 configuration for YOLO-v5 & YOLO-v7 models

Steps to install Deepstream-6.1 on Ubuntu_20.04-LTS, Run YOLO and YOLO.py


Alt Text

***Needed Ubuntu-20 and nvidia driver 510

Step 1: Install Cuda 11.6


wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-60
@keckj
keckj / cupy_gl_interop.py
Last active May 8, 2024 20:31
CuPy/OpenGL interop example
# MIT License
# Copyright (c) 2024 Jean-Baptiste Keck
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
@pabloko
pabloko / 0000-ffmpeg 4.4 with NDI support (updated SDK, fixed timestamps errors).md
Last active February 2, 2024 18:11
ffmpeg 4.4 with NDI support (updated SDK, fixed timestamps errors)

update: https://framagit.org/tytan652/ffmpeg-ndi-patch use this patch. this gist is outdated

ffmpeg 4.4 with NDI

This patch adds libndi_newtek to last ffmpeg version, and fix timecode related issues that produces wrong PTS/DTS timestamps that seems to happen with newer NDI SDKs.

changes

  • Updated libndi methods by newer versions (v2/v3)
[application]
enable-perf-measurement=1
perf-measurement-interval-sec=1
[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=3
uri=file://../data/towncentre.mp4
num-sources=1
@J-Rojas
J-Rojas / build_and_install_gstreamer.sh
Created March 2, 2021 21:27
Gstreamer build on Nvidia jetson platform
#!/bin/bash
cwd="$(realpath $( cd "$(dirname "$0")" ; pwd -P )/.. )"
cd $cwd
function usage() {
echo "usage: [PATH FOR BUILD FOLDER] [GSTREAMER VERSION] [INSTALLATION_PATH] [PATH TO NVIDIA LIBRARIES]"
}
@frank-dspeed
frank-dspeed / Cheatsheet-CONTENT_STREAM_PRODUCTION.md
Last active August 30, 2023 23:39
Cheatsheet Conten Production Streaming Linux Virtual Desktop Webcam

Linux Video

ffmpeg - is the default standard for video operations of all kind

drawtext filter

If you just want to update some text on the screen the easiest method is to use the drawtext filter with the textfile and reload options.

ffmpeg -i input -vf "drawtext=textfile=songs.txt:reload=1" output songs.txt will be reloaded once per frame. Be sure to update it atomically, or it may be read partially, or even fail.

overlay filter

@EONRaider
EONRaider / get_ip_address.py
Last active August 17, 2024 18:47
Get the IP address of a network interface in Python 3
#!/usr/bin/env python3
# https://gist.github.com/EONRaider/3b7a8ca433538dc52b09099c0ea92745
__author__ = 'EONRaider, keybase.io/eonraider'
import fcntl
import socket
import struct
try:
from netifaces import AF_INET, ifaddresses