Skip to content

Instantly share code, notes, and snippets.

View rreece's full-sized avatar
🙈
doing things

Ryan Reece rreece

🙈
doing things
View GitHub Profile
@rreece
rreece / read_yaml.py
Created January 6, 2024 22:44
read_yaml.py
import yaml
def read_yaml(path):
with open(path, 'r') as f:
config = yaml.safe_load(f)
return config
@rreece
rreece / MacOs quick setup.md
Created October 27, 2023 03:17 — forked from LucaCappelletti94/MacOs quick setup.md
MacOs commands to get you started.

MacOs quick setup 🚀

Getting everything ready

1 - Xcode/Ruby/Command line tools

You need to have Xcode installed to proceed.

xcode-select --install
sudo xcodebuild -license accept

2 - Brew

@rreece
rreece / python-supported-versions.md
Created August 12, 2023 18:45
Lifetime of python supported versions

Lifetime of python supported versions

@rreece
rreece / download-coco2017.md
Last active August 12, 2023 18:46
How to download the COCO 2017 dataset

COO 2017 dataset

Ryan downloaded the COCO data from here: https://cocodataset.org/#download

wget http://images.cocodataset.org/zips/val2017.zip
wget http://images.cocodataset.org/zips/test2017.zip
wget http://images.cocodataset.org/annotations/annotations_trainval2017.zip
@rreece
rreece / download-imagenet-1k.md
Created August 1, 2023 22:54
How to download the imagenet-1k dataset
@rreece
rreece / run_shell.py
Created March 11, 2023 02:22
run a process in shell and get its output
import subprocess
def run_shell(cmd):
out = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True, encoding="UTF-8")
return out
@rreece
rreece / path_of_this_file.py
Last active March 3, 2023 19:38
Get the path of this file in python
import os
path_of_this_file = os.path.abspath(__file__)
dir_of_this_file = os.path.dirname(os.path.abspath(__file__))
@rreece
rreece / test_float16_tfrecord.py
Created May 12, 2021 18:11
Writes float16 data to a tfrecord as raw bytes and reads it back.
"""
Writes float16 data to a tfrecord as raw bytes and reads it back.
Based on:
https://stackoverflow.com/questions/40184812/tensorflow-is-it-possible-to-store-tf-record-sequence-examples-as-float16
"""
import argparse
import numpy as np
import tensorflow as tf
@rreece
rreece / path_is_in_git.py
Last active April 20, 2021 17:31
Check if a file is tracked by git
def path_is_in_git(repo, path):
"""
Check if path is tracked by git.
"""
returncode = None
try:
cmd = 'git ls-files --error-unmatch %s' % (path)
_ = subprocess.check_output(cmd,
cwd=repo,
shell=True,
@rreece
rreece / ubuntu_20.04_setup.txt
Last active April 3, 2021 20:50
Ubuntu 20.04 setup post-install
# install chrome with .deb
# setup terminal profile
sudo apt update
sudo apt dist-upgrade
sudo apt install vim htop screen tmux
sudo apt install git
# create ssh key:
ssh-keygen -t rsa