Intern-4
commited on
Commit
·
2d3faee
1
Parent(s):
c2c8678
adding default values
Browse files- .DS_Store +0 -0
- gradio_with_map.py +7 -2
.DS_Store
CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
|
|
gradio_with_map.py
CHANGED
@@ -82,7 +82,12 @@ def predict_image(img, conf_threshold, iou_threshold):
|
|
82 |
print(f"Gimbal Pitch Degree: {gimbal_pitch_degree}")
|
83 |
else:
|
84 |
print("XMP data not found in the image.")
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
86 |
# Extract EXIF data
|
87 |
exif_data = img.info.get("exif")
|
88 |
try:
|
@@ -97,7 +102,7 @@ def predict_image(img, conf_threshold, iou_threshold):
|
|
97 |
img.save(img_path, exif=exif_data) # Save the image with its EXIF data
|
98 |
else:
|
99 |
img.save(img_path) # Save without EXIF data if not available
|
100 |
-
|
101 |
# Convert PIL Image to OpenCV image
|
102 |
img_cv2 = cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR)
|
103 |
|
|
|
82 |
print(f"Gimbal Pitch Degree: {gimbal_pitch_degree}")
|
83 |
else:
|
84 |
print("XMP data not found in the image.")
|
85 |
+
# Set default values when XMP data is not found
|
86 |
+
relative_altitude = 60.0 # Default relative altitude
|
87 |
+
gimbal_yaw_degree = 30.0 # Default yaw degree
|
88 |
+
gimbal_pitch_degree = -90.0 # Default pitch degree
|
89 |
+
|
90 |
+
# Continue with the rest of the function...
|
91 |
# Extract EXIF data
|
92 |
exif_data = img.info.get("exif")
|
93 |
try:
|
|
|
102 |
img.save(img_path, exif=exif_data) # Save the image with its EXIF data
|
103 |
else:
|
104 |
img.save(img_path) # Save without EXIF data if not available
|
105 |
+
|
106 |
# Convert PIL Image to OpenCV image
|
107 |
img_cv2 = cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR)
|
108 |
|