Table of Contents:
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 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() |
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 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 |
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
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
# 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: |
update: https://framagit.org/tytan652/ffmpeg-ndi-patch use this patch. this gist is outdated
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.
- Updated libndi methods by newer versions (v2/v3)
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
[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 |
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 | |
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]" | |
} |
ffmpeg - is the default standard for video operations of all kind
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.
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 | |
# https://gist.github.com/EONRaider/3b7a8ca433538dc52b09099c0ea92745 | |
__author__ = 'EONRaider, keybase.io/eonraider' | |
import fcntl | |
import socket | |
import struct | |
try: | |
from netifaces import AF_INET, ifaddresses |
NewerOlder