short url: caseywatts.com/selfpublish
my book is out! an applied psychology / self-help book targeted at developers: Debugging Your Brain
Markdown --> PDF (as a booklet!)
Markdown --> EPUB and MOBI
| import torch | |
| from collections import OrderedDict | |
| from typing import List | |
| checkpoints_weights_paths: List[str] = ... # sorted in descending order by score | |
| model: torch.nn.Module = ... | |
| def average_weights(state_dicts: List[dict]): | |
| everage_dict = OrderedDict() |
short url: caseywatts.com/selfpublish
my book is out! an applied psychology / self-help book targeted at developers: Debugging Your Brain
Markdown --> PDF (as a booklet!)
Markdown --> EPUB and MOBI
This script reads PascalVOC xml files, and converts them to YOLO txt files.
Note: This script was written and tested on Ubuntu. YMMV on other OS's.
Disclaimer: This code is a modified version of Joseph Redmon's voc_label.py
| # Taps | |
| tap 'homebrew/cask-fonts' | |
| tap 'homebrew/cask-versions' | |
| tap 'heroku/brew' | |
| # Install CLI Tools | |
| ## Shell Utilities | |
| brew 'coreutils' | |
| brew 'findutils' | |
| brew 'autojump' |
The code for this tutorial is here
Opencv provides are useful, but limited, method of building a GUI. A much more complete system could be acheived using pyqt.
The question is, how do we display images. There are quite a few possible routes but perhaps the easiest is to use QLabel since it has a setPixmap function. Below is some code that creates two labels. It then creates a grey pixmap and displays it one of the labels. code: staticLabel1.py
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QVBoxLayout
from PyQt5.QtGui import QPixmap, QColor
import sys| #!/usr/bin/env python3 | |
| import subprocess | |
| import json | |
| import os | |
| from pathlib import Path | |
| import requests | |
| from requests.compat import urljoin |
| /* | |
| parameter JSON | |
| { | |
| "num_layers": 5, | |
| "min_scale": 0.1171875, | |
| "max_scale": 0.75, | |
| "input_size_height": 256, | |
| "input_size_width": 256, | |
| "anchor_offset_x": 0.5, | |
| "anchor_offset_y": 0.5, |
This brief tutorial will show you how to go about analyzing a raw binary firmware image in Ghidra.
I was recently interested in reversing some older Cisco IOS images. Those images come in the form of a single binary blob, without any sort of ELF, Mach-o, or PE header to describe the binary.
While I am using Cisco IOS Images in this example, the same process should apply to other Raw Binary Firmware Images.
| #!/usr/bin/env python3 | |
| ''' | |
| always getting the most recent frame of a camera | |
| ================================================ | |
| Usage: | |
| ------ | |
| freshest_camera_frame.py |