Skip to content

Instantly share code, notes, and snippets.

View cdw's full-sized avatar

Dave Williams cdw

View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import List, Union
import numpy as np
class TicTacToe:
"""Play a game of tictactoe, optionally against a human"""
@cdw
cdw / onnx_convert.py
Last active September 21, 2021 23:02
ONNX Conversion for SQuAD example
torch.onnx.export(model = torch_model,
args = (dummy_input['input_ids'].to(device), dummy_input['attention_mask'].to(device)), #Tuple of inputs for models that take more than one input
f = onnx_path,
export_params = True,
opset_version=11,
do_constant_folding = True,
input_names = ['input_ids', 'attention_mask'],
output_names = ['output'],
dynamic_axes = {'input_ids': {0: 'batch_size'},
'attention_mask': {0: 'batch_size'},
@cdw
cdw / Calibrate camera.ipynb
Created November 5, 2021 22:49
OpenCV camera calibration for borescope
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cdw
cdw / Calibrate farmbot.ipynb
Created November 15, 2021 21:54
Calibrate farmbot camera
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.