Skip to content

Instantly share code, notes, and snippets.

View sar's full-sized avatar

Sar Malik sar

View GitHub Profile
@sar
sar / facialml.md
Created March 18, 2023 04:37 — forked from southrop/facialml.md
List of datasets for training facial recognition
Dataset Identities Images Availability
Labeled Faces in the Wild (LFW) 5,749 13,233 Link
YouTube Faces Database (YFD) 1,595 3,425 videos Link
CelebFaces Attributes (CelebA) 10,177 202,599 Link
Public Figures Face Database (PubFig) 200 58,797 Link
CASIA WebFace Database (CASIA-WebFace) 10,575 494,414 Link
FaceScrub 530 106,863 Link
Cross-Age Celebrity Dataset (CACD) 2,000 163,446 Link
MegaFace Training Set 672,057 4,753,520 Link
@sar
sar / ILGpuGrayscale.csproj
Created January 12, 2022 18:38 — forked from brianmed/ILGpuGrayscale.csproj
Convert RGBA32 image to Grayscale via ILGPU in C#
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ILGPU" Version="0.10.1" />
</ItemGroup>
@sar
sar / nix-ui.md
Created June 12, 2021 00:40 — forked from edolstra/nix-ui.md
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.

@sar
sar / libvirtd-ops.md
Created June 2, 2021 15:33 — forked from jhillyerd/libvirtd-ops.md
Getting started with nixops and libvirtd

Enable libvirtd

Add:

virtualisation.libvirtd.enable = true;

and

users.users.<you>.extraGroups = [ "libvirtd" ];
@sar
sar / youtube-unsubscribe-all.js
Last active May 24, 2021 04:50 — forked from willwm/bookmarklet-youtube-unsubscribe-all.js
Unsubscribe from YouTube channels in bulk on target page https://www.youtube.com/feed/channels
javascript:(() => {
const timeout = 500;
const buttons = document.querySelectorAll("[aria-label^='Unsubscribe from']");
for(let button of buttons) {
setTimeout(() => {
console.group(button.attributes['aria-label'].value);
setTimeout(() => { button.click(); }, timeout);
@sar
sar / fcos-embed-config-in-image
Created May 20, 2021 03:57 — forked from mpreu/fcos-embed-config-in-image
Fedora CoreOS - Example script to inject an Ignition configuration file into the virtual machine image. Originates from this blog post: https://www.matthiaspreu.com/posts/fedora-coreos-embed-ignition-config/.
#!/bin/env bash
set -eo pipefail
#
# Part of a Fedora CoreOS blog post on my website:
# https://www.matthiaspreu.com/posts/fedora-coreos-embed-ignition-config/
#
# Script modifies a FCOS virtual machine image and injects
# an Ignition configuration in it.
#
public class IdentifierMasking
{
private static byte[] _key;
public IdentifierMasking(byte[] key = null)
{
_key = key ?? Sodium.SecretBox.GenerateKey();
}
public string RevealIdentifier(string hidden)
@sar
sar / eslint-prettier-typescript-config.md
Last active February 26, 2021 19:54 — forked from carsenchan/setup.md
Eslint + Prettier for React Typescript

Project setup

Purpose

To ensure that the coding style is consisitent in the project from different members, for React + Typescript projects, it is recommanded set up ESlint and Prettier.

  1. Install the required dev dependencies:
yarn add eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react -D
@sar
sar / trainLMS_pub.py
Created October 26, 2020 16:01 — forked from kinoc/trainLMS_pub.py
Fine-tune GPT-2 1558M on a Titan RTX using IBM Tensorflow Large Model Support v2
#!/usr/bin/env python3
# Usage:
# PYTHONPATH=src ./train --dataset <file|directory|glob>
# Got 1558M to train on a TITAN RTX using IBM Tensorflow_Large_Model_Support
# TLMS can insert explicit swaps in the graph between GPU and CPU, to extend the memory
# But the graph has While_Loop, so you have to use the TFLMSv2 version (which works with TF 1.x)
#
# Download, expand, get the egg out and install.