Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

WIP: Reading PNG images as arrays for MNIST Prediction #399

Merged
merged 15 commits into from
Mar 24, 2020

Conversation

sakshamarora1
Copy link
Contributor

For Issue #371

Create image.csv

cat > image.csv << EOF
key, image
four, image1.png
five, image2.png
three, image3.png
two, image4.png
EOF

After training on the MNIST dataset ,
Predict command :

dffml predict all \
-model tfdnnc \
-model-batchsize 1000 \
-model-hidden 30 50 25 \
-model-clstype int \
-model-predict label:int:1 \
-model-classifications $(seq 0 9) \
-model-features image:int:$((28 * 28)) \
-sources images=csv \
-source-filename image.csv  \
-source-loadfiles image  \
-log debug

@johnandersen777
Copy link

Can you add what you made as the comment here to the docs/usage/mnist.rst file? Also, I recently started trying to get the documentation to be more testable, if you look at docs/quickstart/model.rst (all the literalincludes), examples/quickstart/, and examples/test_quickstart.py (in test_shell) you'll see how I was able to get the quickstart docs to be testable. It would be super great if we could make the mnist example testable like this as well!

@johnandersen777
Copy link

Let's also add a test for CSVSource to make sure that the loading which was added there works.

Copy link

@johnandersen777 johnandersen777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given yash's feedback, let's make the entrypoint on this mnistpng for now. So that no one gets confused. Let's leave the directory name though as png, thanks! Looking great :)

@johnandersen777
Copy link

@sakshamarora1 Looking great! Sorry to hit you with a couple more things but I just got around to responding. Thank you!

Copy link

@johnandersen777 johnandersen777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there! :D Nice work!!

@johnandersen777
Copy link

It looks like we also need to add to CORE_PLUGINS

diff --git a/dffml/service/dev.py b/dffml/service/dev.py
index b88818c9..f8fa2650 100644
--- a/dffml/service/dev.py
+++ b/dffml/service/dev.py
@@ -45,6 +45,7 @@ EMAIL = config.get("user", "email", fallback="[email protected]")
 
 CORE_PLUGINS = [
     ("configloader", "yaml"),
+    ("configloader", "png"),
     ("model", "tensorflow"),
     ("model", "scratch"),
     ("model", "scikit"),

Add Pillow dependency
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants