Skip to content

Instantly share code, notes, and snippets.

@bshambaugh
bshambaugh / gist:b72a95cf70268b68a6377261d87bf6f5
Created August 4, 2023 19:06
sketch_used_for_sensorica_sign_08042023
// video: https://www.youtube.com/watch?v=vH2QmrpCJuw
// code: https://www.tweaking4all.com/hardware/arduino/arduino-all-ledstrip-effects-in-one/
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 6 // On Trinket or Gemma, suggest changing this to 1 // white --> green wire
@bshambaugh
bshambaugh / gist:a1c7d66551f22c8c68cf46ad1aa31477
Created April 25, 2023 14:27
go through pospigos REA for HoloChain tutorial and try to replicate it.
https://www.youtube.com/watch?v=CHbl_tHtr3o
@bshambaugh
bshambaugh / gist:2097200d293cef6b9877c205d8da77a1
Created March 22, 2023 10:34
simple button clicker ... needs server
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<title> Script in head section </title>
<script type = "text/javascript">
function ClickMe() {
console.log("click")
}
</script>
</head>
I worked with this model during the EthDenver https://github.com/spro/char-rnn.pytorch . I did not manage to get the right shape for https://github.com/zkonduit/pyezkl/tree/main/examples/tutorial . (loading the model to convert to *.onnx)
I learned a bit about ML though. :P
You
11:48 AM
https://gist.github.com/bshambaugh/af01e7366ac7f43abd8295533703d990 (other scratch work)
....
You
11:51 AM
Here is my colab python sketches: https://colab.research.google.com/drive/1mi2Rcehz-YWOeXGBNjCe-COR5XhnfPTB
https://docs.arduino.cc/built-in-examples/digital/Button
https://diyprojectslab.com/mcp2515-spi-can-bus-module-with-arduino/#Required_Material
Sensor Data over CAN BUS - Arduino with CAN2515
https://www.youtube.com/watch?v=2gnXKMoFwkc
arduino mcp2515 CAN bus Demo with Push botton and LED
https://www.youtube.com/watch?v=pD22AUjkDAw
@bshambaugh
bshambaugh / gist:af01e7366ac7f43abd8295533703d990
Created March 2, 2023 17:13
likely shape for ONNX for RNN
def main():
torch_model = Circuit()
# Input to the model
shape = [3, 2, 2] /// change to [batch_size, seq_len, input_size]
x = 0.1*torch.rand(1,*shape, requires_grad=True)
y = 0.1*torch.rand(1,*shape, requires_grad=True)
torch_out = torch_model(x, y)
# Export the model
torch.onnx.export(torch_model, # model being run
(x,y), # model input (or a tuple for multiple inputs)
translation of: https://github.com/AXERA-TECH/ax-pipeline/blob/0ba37a0f08346dd80215aa46ac16f199c1f167b9/docs/how_to_deploy_custom_model.md
How to deploy your own other models
Read the documentation
Read through the AXera Pulsar toolchain guide to learn how to convert a custom onnx model into the Joint model used in AX620.
Inserting Post-Processing Code
The model inference in ax-pipeline is basically a standard operation, and pre-processing is not something that needs to be configured in the code.
translation of: https://github.com/AXERA-TECH/ax-pipeline
Update Log
2023-01-16 Added YoloV8, please refer to ModelZoo for details.
2022-12-29 Added sample_v4l2_user_ivps_joint_vo for direct input of NV12 data, if the user has access to NV12 data. Modified the value of enum class SAMPLE_RUN_JOINT_MODEL_TYPE to meet the growing list of model support.
2022-12-26 Added sample code for rtsp input sample_rtsp_ivps_joint_vo
@bshambaugh
bshambaugh / gist:72ee200fb152c0e1e8e1ca9edd4791e3
Created February 18, 2023 21:24
How do I set gasPerPubdata??
:~/Downloads/l2-intro-pre-ethdenver$ yarn hardhat deploy-zksync --script deploy-greeter.ts
yarn run v1.22.19
warning ../package.json: No license field
warning ../../package.json: No license field
$ /home/ubuntu/Downloads/l2-intro-pre-ethdenver/node_modules/.bin/hardhat deploy-zksync --script deploy-greeter.ts
Running deploy script for the Greeter contract
(node:5033) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
An unexpected error occurred:
@bshambaugh
bshambaugh / gist:1dd9b69688e01c295631e7dd230c4c51
Created January 26, 2023 15:12
Ultimate Ethereum Hackathon Survival Guide
https://consensys.net/developers/ultimate-hackathon-survival-guide/
https://swissintech.medium.com/ultimate-ethereum-hackathon-survival-guide-for-2023-94b2b72e17c0