Spaces:
Sleeping
Sleeping
Update app.py
#1
by
Ajay98
- opened
app.py
CHANGED
|
@@ -9,6 +9,18 @@ import pandas as pd
|
|
| 9 |
import matplotlib.pyplot as plt
|
| 10 |
from io import BytesIO
|
| 11 |
from fuzzywuzzy import process
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Attribute mappings: readable names to Salesforce API names
|
| 14 |
ATTRIBUTE_MAPPING = {
|
|
|
|
| 9 |
import matplotlib.pyplot as plt
|
| 10 |
from io import BytesIO
|
| 11 |
from fuzzywuzzy import process
|
| 12 |
+
gr.Image(
|
| 13 |
+
type="numpy",
|
| 14 |
+
source="camera", # Enables camera access
|
| 15 |
+
label="Upload or Take a Photo",
|
| 16 |
+
tool="editor", # Optional: Add editing tools for cropping or annotations
|
| 17 |
+
mirror_webcam=False # Ensures the image is not mirrored
|
| 18 |
+
)
|
| 19 |
+
from PIL import ImageOps
|
| 20 |
+
|
| 21 |
+
def correct_orientation(image):
|
| 22 |
+
return ImageOps.mirror(image)
|
| 23 |
+
|
| 24 |
|
| 25 |
# Attribute mappings: readable names to Salesforce API names
|
| 26 |
ATTRIBUTE_MAPPING = {
|