Skip to content

Instantly share code, notes, and snippets.

View cansik's full-sized avatar
🌿

Florian Bruggisser cansik

🌿
View GitHub Profile
@cansik
cansik / 0-generate-yolo-annotations.py
Last active February 26, 2024 15:36
Generate yolo annotations for the CubiCasa5k dataset.
import os
from pathlib import Path
from PIL import Image
from bs4 import BeautifulSoup
from multiprocessing import Pool, Lock
import re
from svg.path import parse_path
@cansik
cansik / ComputerVisionM1.md
Created June 1, 2022 22:20
Computer Vision with Python on M1 Apple Silicon (arm64)

Computer Vision with Python on M1 Apple Silicon (arm64)

When switching over to a new MacBook with an M1 Apple Silicon chip, I noticed that many python packages I use daily are not compatible with M1 chips. Sometimes there was just no prebuilt wheel, or there were still bugs in the code not allowing the package to build at all. So I decided to create drop-in replacement packages with prebuilt wheels for the Apple Mac M1 (Apple Silicon / arm64).

Every package contains a build script to automatically build it in your own enviroment and a Github CI workflow to build it on Github (if possible).

Here you find a list of all the prebuilt packages. Sometimes the official maintainer have updated their binaries too, so please first check if there is an official build ready for M1.

A librealsense2 python wrapper built for all modern MacOSX versions (intel / silicon) because Intel does only

@cansik
cansik / rm-lfs.sh
Last active May 19, 2022 06:48
A script to remove all lfs files and commits of a repository.
#/bin/zsh
echo "converting lfs to normal git repo..."
if [ $# -eq 0 ]
then
echo "Use: rm-lfs.sh [http-git-url]"
exit
fi
@cansik
cansik / change-command-line-tools.sh
Created April 19, 2018 09:35
Change Xcode Command Line Tools
# change to seperate installation
sudo xcode-select --switch /Library/Developer/CommandLineTools
# change to default installation
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
@cansik
cansik / PointWave.pde
Created November 30, 2015 12:11
Point Wave Processing
import controlP5.*;
// ui
ControlP5 cp5;
Group g1;
//vars
int offset = 15;
int orbitRadius = 20;
int radius = 1;
@cansik
cansik / receiver.ino
Created June 23, 2020 16:28
WiFi NINA / NINA-FW Concurrency Bug Example
#include <SPI.h>
#include <WiFiNINA.h>
#include <WiFiUdp.h>
#define IN_PORT 8000
#define OUT_PORT 9000
// wifi
char ssid[] = "";
char pass[] = "";
@cansik
cansik / FindCurve.pde
Created November 1, 2019 20:37
Find curved position by line
PVector start = new PVector(120, 300);
PVector end = new PVector(400, 230);
float curving = 100f;
int steps = 20;
void setup() {
size(500, 500, FX2D);
}
@cansik
cansik / Filter3DScene.pde
Last active February 26, 2018 17:29
Depth buffer shading to 2d texture
import peasy.*;
final int size = 500;
PShader shader;
PGraphics canvas;
PGraphics depthImage;
PeasyCam cam;
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
void setup() {
size(400, 400);
frameRate(25);
oscP5 = new OscP5(this, 9000);
@cansik
cansik / InfinityAudioPlayer.pde
Last active November 26, 2016 01:06
A simple audio player for processing which is able to loop a certain part of the audio file.
class InfinityAudioPlayer implements AudioListener
{
private Minim minim;
private AudioPlayer player;
private int loopStart;
private int loopEnd;
private boolean stopping = false;