Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-morin committed Feb 15, 2024
1 parent 6ade4fb commit 3c04a65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/inat_inferrer.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ def prepare_image_for_inference(self, file_path):
image = tf.image.resize(image, [299, 299], tf.image.ResizeMethod.NEAREST_NEIGHBOR)

filename = os.path.basename(file_path)
output_file_path = '/home/inaturalist/vision/save/' + filename
output_file_path = '/home/inaturalist/vision/resized/' + filename

resized_image_uint8 = tf.cast(image, tf.uint8)
resized_image_uint8 = tf.image.convert_image_dtype(image, tf.uint8)
image_bytes = tf.io.encode_jpeg(resized_image_uint8)
with tf.io.gfile.GFile(output_file_path, 'wb') as f:
f.write(image_bytes.numpy())
Expand Down

0 comments on commit 3c04a65

Please sign in to comment.