Skip to content

Instantly share code, notes, and snippets.

View thepycoder's full-sized avatar

Victor Sonck thepycoder

View GitHub Profile
@thepycoder
thepycoder / dir_tree.txt
Created August 16, 2022 11:11
Directory tree
..
|_ yolov5
|_ datasets
|_ coco128
|_ images
|_ labels
|_ LICENSE
|_ README.txt
@thepycoder
thepycoder / train.sh
Created August 16, 2022 09:57
Train YOLOv5
python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache
@thepycoder
thepycoder / init.sh
Last active August 16, 2022 09:53
ClearML Init
clearml-init
@thepycoder
thepycoder / install.sh
Created August 16, 2022 09:03
Install ClearML
pip install clearml
@thepycoder
thepycoder / rpi_screen_on_off.sh
Created April 25, 2022 07:48
Enable or Disable raspberry pi screen with a single command
$ xset -display :0 dpms force on
$ xset -display :0 dpms force off
@thepycoder
thepycoder / ui_code.py
Created April 25, 2022 07:47
PySimpleGUI code for pushup lockscreen
class PushupLockscreen:
def __init__(self):
sg.theme('Black')
# define the window layout
layout = [
[
sg.Column(
[[sg.Image(filename='', key='image')]]
),
sg.Column(
@thepycoder
thepycoder / dataset_creation.py
Created April 25, 2022 07:40
Create a ClearML dataset
# Get the previous dataset or create one if it doesn't exist yet
dataset = Dataset.get(
dataset_project=CLEARML_PROJECT,
dataset_name=CLEARML_DATASET_NAME,
auto_create=True,
writable_copy=True
)
# Add the labeled files (can include the old ones)
dataset.add_files(path=save_path, dataset_path=save_path)
# Upload only files that are new
@thepycoder
thepycoder / lockscreens.sh
Created April 25, 2022 07:30
Lockscreen Commands
$ gnome-screensaver-command --lock
$ i3lock
$ xdg-screensaver lock
@thepycoder
thepycoder / i3lock.sh
Created April 25, 2022 07:29
i3lock script
# All these commands will be launched from a remote SSH session
# so we need to add the DISPLAY=:0 environment variable to tell the command
# to use the main screen, otherwise it will whine that it found no display
$ export DISPLAY=:0
# Launch i3lock with a custom screensaver
$ i3lock -i /path/to/custom/screensaver.png
# Spam backspace
$ xdotool key BackSpace
# Fill in password
$ xdotool type mypassword
task.execute_remotely(queue_name='services', exit_process=True)