eaplatanios / tensorflow_scala

TensorFlow API for the Scala Programming Language
http://platanios.org/tensorflow_scala/
Apache License 2.0
936 stars 96 forks source link

Add ops for jpeg decoding/encoding #68

Closed sbrunk closed 6 years ago

sbrunk commented 6 years ago

Fixes #32.

Starting with JPEG because that's what I needed first. I hope to be able to add the PNG codec ops as well soon.

@eaplatanios while trying this out, I realized that the Files ops readFile/writeFile are private. Is this on purpose? If not, I can create PR adding it to the API, i've done it locally already in order to read some images.

eaplatanios commented 6 years ago

@sbrunk Thanks! I will make some comments for edits on the code. Also, I just exposed the functions for creating file IO ops. Thanks for pointing that out! :)

sbrunk commented 6 years ago

Ok I just pushed an update that should address your remarks. Also rebased against current master.

Beware that right now the "enum" objects are exposed as top level objects under the tf API.

val decoded = tf.decodeJpeg(file, dctMethod = tf.DctMethod.IntegerFast)

I'm not sure whether it's better to have it under a sub namespace like image or not.

eaplatanios commented 6 years ago

@sbrunk Thanks! This looks good to me. I'll merge and maybe make some minor edits like the namespace edit that you suggested.