Skip to content

Commit

Permalink
add lcd images
Browse files Browse the repository at this point in the history
  • Loading branch information
haverland committed Feb 26, 2023
1 parent 9032721 commit abbc1e9
Show file tree
Hide file tree
Showing 193 changed files with 1,031 additions and 1,100 deletions.
136 changes: 85 additions & 51 deletions Compare_all_tflite.ipynb

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ but in most times with delta=0.1

## Versions

### 1.6 (2002-12-27)
### 1.6.1 (2023-02-26)
* new images (lcd)
* fixed quantization bug - use all images for dataset
* dig-class-161_s2

### 1.6 (2022-12-27)
* new images
* dig-class-160_s2

Expand Down
Binary file modified b2n/__pycache__/plotfunctions.cpython-310.pyc
Binary file not shown.
Binary file modified b2n/data/__pycache__/ziffer.cpython-310.pyc
Binary file not shown.
Binary file modified b2n/data/__pycache__/ziffer.cpython-39.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions b2n/data/ziffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ def ziffer_data(input_dir='images', input_shape=(32,20,3)):
base = os.path.basename(aktfile)

# get label from filename (1.2_ new or 1_ old),
if (base[1]=="."):
if (base[1]=="." and not base[2] == 'j'):
target = base[0:3]
else:
target = base[0:1]
#print(base)
category = float(target)

test_image = Image.open(aktfile).resize((input_shape[1],input_shape[0]))
Expand Down
Binary file modified b2n/models/__pycache__/cnn32.cpython-310.pyc
Binary file not shown.
Binary file modified b2n/models/__pycache__/prune_quantize.cpython-310.pyc
Binary file not shown.
Binary file modified b2n/models/__pycache__/prune_quantize.cpython-39.pyc
Binary file not shown.
5 changes: 2 additions & 3 deletions b2n/models/prune_quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def quantization_sparse(model, x_train):

def representative_dataset():
for n in range(x_train[0].size):
data = np.expand_dims(x_train[5], axis=0)
data = np.expand_dims(x_train[n], axis=0)
yield [data.astype(np.float32)]

converter2 = tf.lite.TFLiteConverter.from_keras_model(model)
Expand All @@ -103,13 +103,12 @@ def quantization_default(model, x_train):

def representative_dataset():
for n in range(x_train[0].size):
data = np.expand_dims(x_train[5], axis=0)
data = np.expand_dims(x_train[n], axis=0)
yield [data.astype(np.float32)]

converter2 = tf.lite.TFLiteConverter.from_keras_model(model)
converter2.representative_dataset = representative_dataset
converter2.optimizations = [tf.lite.Optimize.DEFAULT]
converter2.representative_dataset = representative_dataset
# Ensure that if any ops can't be quantized, the converter throws an error
converter2.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
# Set the input and output tensors to uint8 (APIs added in r2.3)
Expand Down
888 changes: 495 additions & 393 deletions dig-class100-s2.ipynb

Large diffs are not rendered by default.

40 changes: 16 additions & 24 deletions dig-class100_s0.ipynb

Large diffs are not rendered by default.

1,051 changes: 425 additions & 626 deletions dig_class100-s1.ipynb

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/collected/red-on-black/0.jpg
Diff not rendered.
Binary file removed images/collected/red-on-black/1.jpg
Diff not rendered.
Binary file removed images/collected/red-on-black/2.jpg
Diff not rendered.
Binary file removed images/collected/red-on-black/3.jpg
Diff not rendered.
Binary file removed images/collected/red-on-black/4.jpg
Diff not rendered.
Binary file removed images/collected/red-on-black/5.jpg
Diff not rendered.
Binary file removed images/collected/red-on-black/6.jpg
Diff not rendered.
Binary file removed images/collected/red-on-black/7.jpg
Diff not rendered.
Binary file removed images/collected/red-on-black/8.jpg
Diff not rendered.
Binary file removed images/collected/red-on-black/9.jpg
Diff not rendered.
Binary file added output/dig-class100-0161_s2_q.tflite
Binary file not shown.
Binary file removed output/dig-class100-s2_20230108-143516_q.tflite
Binary file not shown.
Binary file removed output/dig-class100-s2_20230108-145224_q.tflite
Binary file not shown.

0 comments on commit abbc1e9

Please sign in to comment.