Skip to content

Instantly share code, notes, and snippets.

View imneonizer's full-sized avatar
:octocat:
Developing for the python community!

Nitin Rai imneonizer

:octocat:
Developing for the python community!
  • SmartCow.ai
  • Delhi, India
  • 05:36 (UTC +05:30)
  • X @imneonizer
View GitHub Profile
@imneonizer
imneonizer / detect_medimtx_stream_availability.js
Created March 8, 2024 08:17
Check if the stream served by mediamtx is available (paste it in the console window in browser for that stream)
// Find the video element that is supposed to play the stream
const videoElement = document.querySelector('video');
if (videoElement) {
const stream = videoElement.srcObject;
// Check if the stream is available and active
if (stream instanceof MediaStream && stream.active) {
// Get video tracks from the stream
const videoTracks = stream.getVideoTracks();
@imneonizer
imneonizer / content.md
Created October 31, 2023 04:23
AI Application Development Specialisation in Computer Vision

AI Application Development Specialisation in Computer Vision

This course navigates students through the exciting realm of AI, spotlighting Computer Vision applications. Starting from Python programming and Git, it smoothly transitions into developing AI applications using Docker and OpenCV. Assignments each week provide hands-on experience, cementing the key learnings.

Week 1: Grasping the Basics- Python and Git

Topics

  • Python Programming: Understand syntax, variables, loops, conditionals, lists, tuples, and dictionaries
  • Starting with Git: Learn to clone, commit, branch, and merge
@imneonizer
imneonizer / .vscode_settings.json
Created May 7, 2023 17:35
Python black formatter vs code settings
{
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": "<path-to-black-formatter>"
}
@imneonizer
imneonizer / docker-compose-test-gpu.yml
Last active May 7, 2023 15:02
Nvidia GPU test using docker-compose
version: "3.8"
services:
app:
image: nvidia/cuda:11.6.2-base-ubuntu20.04
command: nvidia-smi
deploy:
resources:
reservations:
devices:
@imneonizer
imneonizer / OpenCVMedia.py
Created April 18, 2023 14:52 — forked from kueblert/OpenCVMedia.py
aiortc opencv webcam stream
import asyncio
import fractions
import logging
import threading
import time
from typing import Optional, Set, Tuple
import av
from av import AudioFrame, VideoFrame
from aiortc.mediastreams import AUDIO_PTIME, MediaStreamError, MediaStreamTrack

Install aria2c:

sudo apt install aria2 -y

Use below command to utilize full bandwidth:

aria2c --file-allocation=none -c -x 10 -s 10 -d "mydir" URL --check-certificate=false

-c allows continuation of download if it gets interrupted, -x 10 and -s 10 allow up to 10 connections per server, and -d "mydir" outputs file to directory mydir.

import torch
import torchvision
from torchvision import transforms
from torch.utils.data import DataLoader
data_path = './Archive_jpg/'
transform_img = transforms.Compose([
transforms.Resize((480, 640)),
# transforms.CenterCrop(256),
import redis
import fakeredis
import ujson
from contextlib import suppress
class RedisClient:
def __init__(self, host=None, port=6379, db=0, prefix='libtorrent'):
self.prefix = prefix
self.host = host
from google.colab.output import eval_js
print(eval_js("google.colab.kernel.proxyPort(8000)"))
@imneonizer
imneonizer / MPU6050_esp8266.ino
Last active March 1, 2022 08:47
MPU6050_esp8266
#include <Wire.h>
#include <ESP8266WiFi.h>
const int MPU_addr = 0x68; // I2C address of the MPU-6050
int16_t AcX, AcY, AcZ, Tmp, GyX, GyY, GyZ;
float ax = 0, ay = 0, az = 0, gx = 0, gy = 0, gz = 0, Amp=0;
// SCL -> D1
// SDA -> D2