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 92019e9 commit 72922bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/inat_inferrer.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ 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)
resized_image_np = image.numpy()
pil_image = Image.fromarray(np.uint8(resized_image_np))
output_file_path = '/home/inaturalist/vision/save/' + filename
pil_image.save(output_file_path)
image_bytes = tf.io.encode_jpeg(image)
with tf.io.gfile.GFile(output_file_path, 'wb') as f:
f.write(image_bytes.numpy())

result = tf.expand_dims(image, 0)
END_TIME_RESIZE = time.time()
Expand Down

0 comments on commit 72922bd

Please sign in to comment.