Skip to content

Instantly share code, notes, and snippets.

@shawwn
shawwn / test_tensorflow_metal.py
Created June 16, 2021 00:33
A script to test M1 GPU training via the tensorflow-metal plugin
import tensorflow.compat.v2 as tf
import tensorflow_datasets as tfds
tf.get_logger().setLevel('DEBUG')
tf.enable_v2_behavior()
from tensorflow.python.framework.ops import disable_eager_execution
disable_eager_execution()
@mattdesl
mattdesl / pinning.md
Last active January 28, 2023 19:56
hicetnunc IPFS pinning

Hicetnunc.xyz IPFS Pinning

💡 These steps will become easier, less technical, and more accessible as more open tools begin to emerge around Hicetnunc pinning. The steps below assume macOS but should work similarly across other platforms. This gist can be seen as a working draft toward more polished documentation; if you see any issues please post a comment below.

Basic Idea

Hicetnunc.xyz aims to be "decentralized" which means the OBJKTs are owned by the users, not the platform. So, in theory, if hicetnunc disappears, another marketplace could emerge on the same (user-owned) assets. But, this paradigm of decentralization means that you own the assets; so the responsibility to maintain them lies on the users, not the platform.

Of course, hicetnunc and some of its users will probably also make an effort to help maintain all the assets on its platform; but you should not rely purely on that, as it goes against the core ethos of dec

@Quasimondo
Quasimondo / hic_et_nunc_get_all_token_data.py
Created April 2, 2021 12:03
Some basic code to retrieve hic et nunc token data from better-call.dev
import os
import pickle
import requests
#download cached token data here:
#https://drive.google.com/file/d/1g_4w_Re5Y0NmcS2Y55WQzESWDeL2dey6/view?usp=sharing
#and put it into the same folder as this file
cachedTokenData = {"maxTokenID":-1,"knownTokenIds":{},"data":[]}
if os.path.exists("cached_token_data.pickle"):
@apivovarov
apivovarov / convert-to-coreml.md
Last active July 29, 2023 21:51
Use AWS Sagemaker to convert DL models to CoreML

Convert Tensorflow/PyTorch models to CoreML with AWS Sagemaker

Intro

CoreML Conversion Demo wiki explains how to:

  • Prepare Image Classification models using Tensorflow and PyTorch
  • Convert the models to CoreML format
  • Run CoreML models on iPad simulator

Software installation

Currently, Neo CoreML conversion service supports models saved in the following frameworks / versions:

# Modified StyleGAN2 Projector with CLIP, addl. losses, kmeans, etc.
# by Peter Baylies, 2021 -- @pbaylies on Twitter
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
@l4rz
l4rz / gist:7040835c3f8266d8b8ea3615a0b49494
Created February 25, 2021 18:35
ALEPH by @advadnoun but for local execution
#
# ALEPH by Advadnoun, https://colab.research.google.com/drive/1Q-TbYvASMPRMXCOQjkxxf72CXYjR_8Vp
# "This is a notebook that uses DALL-E's decoder and CLIP to generate images from text. I will very likely make this better & easier to use in the future."
#
# rearranged to run locally on faster GPU
#
# directions:
# clone https://github.com/openai/DALL-E/ and https://github.com/openai/CLIP
# copy relevant files into one dir with this script
# install torch==1.7.1 and other stuff
@DreamingInBinary
DreamingInBinary / Best in Class iOS Checklist
Last active January 29, 2024 18:18
This is a public checklist updated every year after the latest version of iOS and iPadOS are shipped. It's a boiled down version of a "Best in Class" app checklist created by Jordan Morgan.
# A Best in Class Checklist
A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10.
> To use this, create a Github Issue in your own repo, and simply copy and paste this text.
## iOS Core Technology
_Things any iOS app can benefit from_
- [ ] iCloud Sync
- [ ] Focus Filter Support
# git clone https://github.com/NVlabs/stylegan2
import os
import numpy as np
from scipy.interpolate import interp1d
from scipy.io import wavfile
import matplotlib.pyplot as plt
import PIL.Image
import moviepy.editor
import dnnlib
#!/bin/bash
# git clone https://github.com/shawwn/stylegan2 -b tpu
source "$HOME/bin/activate-tf1"
set -x
#export TPU_NAME=grpc://0.tcp.ngrok.io:15992
export TPU_NAME=grpc://0.tcp.ngrok.io:17042
export GCE_BUCKET=gs://sgappa-multi/stylegan-encoder
@shubhamwagh
shubhamwagh / TexturedMeshSteps.md
Last active April 24, 2024 14:26
Steps to create textured mesh from point cloud using Meshlab

Steps to create Textured Mesh from Point Cloud using Meshlab

Get your PointCloud into MeshLab

  • Import the pointcloud file in ".ply" file format in Meshlab. Before importing make sure you do some pre-processing / cleaning on point cloud so as to ease the process of meshing.

Point Cloud Simplification and Normals Computation

  • Next we need to reduce the number of point samples for smooth meshing.
    • So go to Filters -> Point Set -> Point Cloud Simplification. Enter Number of samples circa 5% of original number of points. Make sure Best Sample Heuristic is checked.
  • After point cloud simplification, make sure to select Simplified point cloud in the Show Layer Dialog on the right hand side. If not visible, it can be opened by navigating to View -> Show Layer Dialog. Now we need to compute normals for point set.
  • So go to Filters -> Point Set -> Compute normals for point sets . Enter Neighbour num between 10 - 100. Initially try with 10 and