Spaces:
Sleeping
Sleeping
Commit ·
22bca70
1
Parent(s): 48f4c22
Update app.py
Browse files
app.py
CHANGED
|
@@ -143,7 +143,7 @@ from PIL import Image
|
|
| 143 |
|
| 144 |
def greet_user(CTScanImage):
|
| 145 |
image=gd.inputs.Image()
|
| 146 |
-
pil_image = Image.fromarray(
|
| 147 |
pil_image_resized = pil_image.resize((224,224))
|
| 148 |
img_array = tf.keras.utils.img_to_array(pil_image_resized)
|
| 149 |
img_array = tf.expand_dims(img_array, 0)
|
|
@@ -154,6 +154,6 @@ def greet_user(CTScanImage):
|
|
| 154 |
return image_output_class
|
| 155 |
|
| 156 |
app = gd.Interface(fn = greet_user, inputs='image', outputs='text',share=True)
|
| 157 |
-
app.launch()
|
| 158 |
public_url=app.share(title="Lung Cancer Detection", description="Upload your CT Scan Image to know Whether You have cancer or not")
|
| 159 |
-
print(f"Shareable link: {public_url}")
|
|
|
|
|
|
| 143 |
|
| 144 |
def greet_user(CTScanImage):
|
| 145 |
image=gd.inputs.Image()
|
| 146 |
+
pil_image = Image.fromarray(CTScanImage.astype('uint8'), 'RGB')
|
| 147 |
pil_image_resized = pil_image.resize((224,224))
|
| 148 |
img_array = tf.keras.utils.img_to_array(pil_image_resized)
|
| 149 |
img_array = tf.expand_dims(img_array, 0)
|
|
|
|
| 154 |
return image_output_class
|
| 155 |
|
| 156 |
app = gd.Interface(fn = greet_user, inputs='image', outputs='text',share=True)
|
|
|
|
| 157 |
public_url=app.share(title="Lung Cancer Detection", description="Upload your CT Scan Image to know Whether You have cancer or not")
|
| 158 |
+
print(f"Shareable link: {public_url}")
|
| 159 |
+
app.launch()
|