KhadijaAsehnoune12
commited on
Commit
•
a332ed4
1
Parent(s):
c77ff50
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from transformers import ViTFeatureExtractor, ViTForImageClassification
|
4 |
-
from PIL import Image
|
5 |
import numpy as np
|
6 |
import rembg
|
7 |
|
@@ -43,16 +43,11 @@ def remove_background(image):
|
|
43 |
|
44 |
return output_image
|
45 |
|
46 |
-
def enhance_details(image):
|
47 |
-
# Apply a sharpening filter to enhance details
|
48 |
-
enhanced_image = image.filter(ImageFilter.SHARPEN)
|
49 |
-
|
50 |
-
return enhanced_image
|
51 |
|
52 |
def predict(image):
|
53 |
# Remove the background
|
54 |
image = remove_background(image)
|
55 |
-
|
56 |
# Preprocess the image
|
57 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
58 |
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from transformers import ViTFeatureExtractor, ViTForImageClassification
|
4 |
+
from PIL import Image
|
5 |
import numpy as np
|
6 |
import rembg
|
7 |
|
|
|
43 |
|
44 |
return output_image
|
45 |
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
def predict(image):
|
48 |
# Remove the background
|
49 |
image = remove_background(image)
|
50 |
+
|
51 |
# Preprocess the image
|
52 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
53 |
|