Skip to content

Instantly share code, notes, and snippets.

View ashwanirathee's full-sized avatar
☀️
day

Ashwani Rathee ashwanirathee

☀️
day
View GitHub Profile
@ashwanirathee
ashwanirathee / ego_blur.def
Created April 30, 2025 21:39
ego_blur apptainer
Bootstrap: docker
From: nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
%labels
Author AshwaniRathee
Version v1.0
Description "EgoBlur container with LibTorch 2.1 and CUDA 12.1"
%environment
export PATH=/usr/local/cuda/bin:$PATH
>>> ./build/main 1 8000 8001,8002 1
[P2P] Initialized with port: 8000, peers: 0
[FD] Initialized with timeout: 5000ms, interval: 2000ms
[RB] Initialized with self_port: 8000, peers: 2
[RB] Subscribing to events...
[App] Initialized with broadcaster type: 19ReliableBroadcaster
[App] Subscribing to events...
[FD] Starting failure detector...
[P2P] Thread started.
[App] Entering input loop. Type 'exit' to quit.
import matplotlib.pyplot as plt
sizes1 = [10**1, 10**2, 10**3, 10**4, 10**5, 10**6, 10**7]
cpu_times = [.002759, .003312, .002829, .005624, .022991, .233091, 2.803243]
gpu_times = [.721383, .142897, .107374, .105827, .210548, .309812, 1.781547]
recursive_cpu_times = [.002717, .002820, .002900, .004930, .025398, .259715, 2.869863]
recursive_gpu_times = [.120757, .119873, .146225, .184894, 1.020488, 8.396131, 85.096905]
iterative_cpu_times = [.002658, .002787, .002795, .010535, .025303, .266396, 2.875699]
iterative_gpu_times = [.102239, .104223, .151719, .106983, .132566, .481036, 3.875283]
@ashwanirathee
ashwanirathee / test.js
Created January 23, 2025 20:03
webgl class
class WebGLRenderer {
constructor() {}
// draw every shape that's supposed to be on the canvas
render(scene) {
// check the time at the start of this function
var startTime = performance.now();
var globalRotMat = new Matrix4().rotate(g_globalAngle, 0, 1, 0);
gl.uniformMatrix4fv(u_GlobalRotateMatrix, false, globalRotMat.elements);
#include <vtkCamera.h>
#include <vtkColorTransferFunction.h>
#include <vtkFixedPointVolumeRayCastMapper.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkPiecewiseFunction.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkVolume.h>
@ashwanirathee
ashwanirathee / rc-circuit.jl
Created December 6, 2023 14:48
RC Circuits
using Revise
using ModelingToolkit
using ModelingToolkitStandardLibrary.Blocks: RealInput, Step, Sine, Cosine
using ModelingToolkitStandardLibrary.Electrical
using OrdinaryDiffEq
using Plots
@parameters t
@component function ControlledSwitch(; name)
@ashwanirathee
ashwanirathee / log.txt
Created August 15, 2023 05:45
JuliaImages Monorepo
Script started on 2023-08-15 11:12:51+05:30 [TERM="xterm-256color" TTY="/dev/pts/4" COLUMNS="142" LINES="19"]
[?2004h]0;ash@Ash: ~ash@Ash:~$ exit./test.shmake clean./test.sh
[?2004l
[sudo] password for ash:
Reading package lists... 0%
Reading package lists... 100%
Reading package lists... Done
@ashwanirathee
ashwanirathee / stable_diffusion.jl
Created August 6, 2023 18:54
Stable diffusion
### A Pluto.jl notebook ###
# v0.19.27
using Markdown
using InteractiveUtils
# ╔═╡ 2c54a4d5-cd92-4f43-b972-48e57da5c444
using ImageCore, TestImages
# ╔═╡ 3409b322-346b-11ee-2d6d-036b6fe74224
@ashwanirathee
ashwanirathee / interactivity
Created August 2, 2023 17:05
Pluto Interactivity
### A Pluto.jl notebook ###
# v0.19.27
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
@ashwanirathee
ashwanirathee / Project.toml
Last active August 10, 2023 06:10
calibration work
[deps]
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
ImageDraw = "4381153b-2b60-58ae-a1ba-fd683676385f"
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
LazySets = "b4f0291d-fe17-52bc-9479-3d1a343d9043"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Luxor = "ae8d54c2-7ccd-5906-9d76-62fc9837b5bc"
Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781"