Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

test.py 579 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  1. import tensorflow as tf
  2. import numpy as np
  3. import os
  4. model = tf.keras.models.load_model(os.path.join("model", "model.h5"))
  5. print(model.name)
  6. imagename = "Normal- (8).jpg"
  7. test_image = tf.keras.preprocessing.image.load_img(imagename, target_size = (224,224))
  8. test_image = tf.keras.preprocessing.image.img_to_array(test_image)
  9. test_image = np.expand_dims(test_image, axis = 0)
  10. result = np.argmax(model.predict(test_image), axis=1)
  11. print(result)
  12. print(f"type of result {type(result)}")
  13. if result[0] == 1:
  14. print('Tumor')
  15. else:
  16. print("normal")
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...