Skip to content

Instantly share code, notes, and snippets.

View ajinkyapuar's full-sized avatar

Ajinkya Puar ajinkyapuar

View GitHub Profile
# Must have conda installed
# It costs approximately $0.2 (in GPT-4 API fees) to generate one example with analysis and design, and around $2.0 for a full project.
conda create -n metagpt python=3.11.4
conda activate metagpt
npm --version # to check you have npm installed
# optional: install node if you don't have it
npm install -g @mermaid-js/mermaid-cli
git clone https://github.com/geekan/metagpt
cd metagpt
# Script for converting a HF Diffusers saved pipeline to a Stable Diffusion checkpoint.
# *Only* converts the UNet, VAE, and Text Encoder.
# Does not convert optimizer state or any other thing.
# Written by jachiam
import argparse
import os.path as osp
import torch
@MathijsdeBoer
MathijsdeBoer / Dockerfile
Created May 20, 2022 08:00
PyTorch3d Dockerfile
# syntax=docker/dockerfile:1
# PyTorch3D supports up to PyTorch 1.11, 22.02 is the last image to use 1.11 before they
# upgrade to 1.12
FROM nvcr.io/nvidia/pytorch:22.02-py3
WORKDIR /app
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Amsterdam
# Get the basic Linux packages upgraded and get the development tools setup
@ShawnHymel
ShawnHymel / quantized-inference-example.py
Last active December 9, 2023 07:47
TensorFlow Lite (TFLite) Python Inference Example with Quantization
# TFLite quantized inference example
#
# Based on:
# https://www.tensorflow.org/lite/performance/post_training_integer_quant
# https://www.tensorflow.org/lite/api_docs/java/org/tensorflow/lite/Tensor.QuantizationParams
import numpy as np
import tensorflow as tf
# Location of tflite model file (float32 or int8 quantized)
import functools
import numpy as np
import tensorflow.compat.v1 as tf
from tensorflow.python.tpu import tpu_function
BATCH_NORM_DECAY = 0.9
BATCH_NORM_EPSILON = 1e-5
@interactivetech
interactivetech / pycocotools_tutorial.ipynb
Created January 17, 2021 22:10
Detailed Walkthrough of pycocotools and Python COCO API
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eldadfux
eldadfux / .env
Last active June 29, 2022 05:24
Appwrite 0.14 - Stack
_APP_ENV=production
_APP_LOCALE=en
_APP_OPTIONS_ABUSE=enabled
_APP_OPTIONS_FORCE_HTTPS=disabled
_APP_OPENSSL_KEY_V1=your-secret-key
_APP_DOMAIN=localhost
_APP_DOMAIN_TARGET=localhost
_APP_CONSOLE_WHITELIST_ROOT=enabled
_APP_CONSOLE_WHITELIST_EMAILS=
_APP_CONSOLE_WHITELIST_IPS=
@AlaaEddinAlbarghoth
AlaaEddinAlbarghoth / DeviceInfo.kt
Created December 2, 2020 13:43
Get the Device serial number for all versions of android
fun getDeviceSerial(applicationContext: Context): String? {
var serialNumber: String?
try {
val c = Class.forName("android.os.SystemProperties")
val get = c.getMethod("get", String::class.java)
serialNumber = get.invoke(c, "gsm.sn1") as String
@ESWZY
ESWZY / compress_video.py
Last active May 9, 2024 17:48
An example Python code for compressing video file to target size.
# Simplified version and explanation at: https://stackoverflow.com/a/64439347/12866353
import os
import ffmpeg
def compress_video(video_full_path, size_upper_bound, two_pass=True, filename_suffix='cps_'):
"""
Compress video file to max-supported size.
:param video_full_path: the video you want to compress.
:param size_upper_bound: Max video size in KB.
@shks
shks / OSC-Python.py
Created June 19, 2020 17:21
Touchdesigner - python communication via OSC
#python
'''
setup instruction
for Install pythonosc
pip install python-osc
'''
from pythonosc import dispatcher