Returns path to JPEG picture.
(height=None, width=None, channels=CHANNELS_NB)
| 38 | |
| 39 | |
| 40 | def get_random_jpeg(height=None, width=None, channels=CHANNELS_NB): |
| 41 | """Returns path to JPEG picture.""" |
| 42 | image = get_random_picture(height, width, channels) |
| 43 | jpeg = tf.image.encode_jpeg(image) |
| 44 | with utils.nogpu_session() as sess: |
| 45 | res = sess.run(jpeg) |
| 46 | fobj = tempfile.NamedTemporaryFile(delete=False, mode='wb', suffix='.JPEG') |
| 47 | fobj.write(res) |
| 48 | fobj.close() |
| 49 | return fobj.name |
| 50 | |
| 51 | |
| 52 | def get_random_png(height=None, width=None, channels=CHANNELS_NB): |
nothing calls this directly
no test coverage detected