Skip to content

Commit

Permalink
Merge branch 'develop' into pytorch-2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Muchsel committed Sep 18, 2023
2 parents 7958a88 + 10a366d commit fd88872
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 2 deletions.
39 changes: 39 additions & 0 deletions networks/ai85-bayer2rgb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# Compatible with MAX78000

arch: bayer2rgbnet
dataset: Bayer

# Define layer parameters in order of the layer sequence
layers:

# Layer 0 (l1): Conv2d: in 4ch, out 3ch, (45, 45) -> (45, 45)
- out_offset: 0x0000
processors: 0x000000000000000f
output_processors: 0x0000000000070000
operation: conv2d
kernel_size: 1x1
pad: 0
activate: None
name: l1

# Layer 1 (l2): ConvTranspose2d: in 3ch, out 3ch, (45, 45) -> (90, 90)
- out_offset: 0x0000
processors: 0x0000000000070000
output_processors: 0x0007000000000000
operation: convtranspose2d
kernel_size: 3x3
pad: 1
activate: None
name: l2

# Layer 2 (l3): Conv2d: in 3ch, out 3ch, (90, 90) -> (90, 90)
- out_offset: 0x0000
processors: 0x0007000000000000
output_processors: 0x0000000000000007
operation: conv2d
kernel_size: 3x3
pad: 1
activate: None
name: l3
output: true
6 changes: 6 additions & 0 deletions scripts/gen_bayer2rgb_max78000.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
DEVICE="MAX78000"
TARGET="sdk/Examples/$DEVICE/CNN"
COMMON_ARGS="--device $DEVICE --timer 0 --display-checkpoint --verbose"

python ai8xize.py --test-dir $TARGET --prefix bayer2rgb --checkpoint-file trained/ai85-b2rgb-qat8-q.pth.tar --config-file networks/ai85-bayer2rgb.yaml --fifo --sample-input tests/sample_imagenet_bayer.npy $COMMON_ARGS "$@"
2 changes: 2 additions & 0 deletions scripts/quantize_bayer2rgb_imagenet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
python quantize.py trained/ai85-bayer2rgb-qat8.pth.tar trained/ai85-bayer2rgb-qat8-q.pth.tar --device MAX78000 "$@"
2 changes: 1 addition & 1 deletion scripts/quantize_kws20_v2_ai87.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
python3 quantize.py trained/ai87-kws20_v2-qat8.pth.tar trained/ai87-kws20_v2-qat8-q.pth.tar --device MAX78000 -v "$@"
python quantize.py trained/ai87-kws20_v2-qat8.pth.tar trained/ai87-kws20_v2-qat8-q.pth.tar --device MAX78000 -v "$@"
2 changes: 1 addition & 1 deletion scripts/quantize_kws20_v3_ai87.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
python3 quantize.py trained/ai87-kws20_v3-qat8.pth.tar trained/ai87-kws20_v3-qat8-q.pth.tar --device MAX78002 -v "$@"
python quantize.py trained/ai87-kws20_v3-qat8.pth.tar trained/ai87-kws20_v3-qat8-q.pth.tar --device MAX78002 -v "$@"
Binary file added trained/ai85-bayer2rgb-qat8-q.pth.tar
Binary file not shown.
Binary file added trained/ai85-bayer2rgb-qat8.pth.tar
Binary file not shown.

0 comments on commit fd88872

Please sign in to comment.