refactor: rename prediction function for clarity and update requirements to use GitHub source for transformers
Browse files- app_test.py +2 -2
- requirements.txt +1 -1
app_test.py
CHANGED
@@ -204,7 +204,7 @@ def infer(image: Image.Image, model_id: str, confidence_threshold: float = 0.75)
|
|
204 |
"Label": f"Error: {str(e)}"
|
205 |
}
|
206 |
|
207 |
-
def
|
208 |
"""Full ensemble prediction pipeline.
|
209 |
|
210 |
Args:
|
@@ -413,7 +413,7 @@ def simple_prediction(img):
|
|
413 |
|
414 |
|
415 |
detection_model_eval_playground = gr.Interface(
|
416 |
-
fn=
|
417 |
inputs=[
|
418 |
gr.Image(label="Upload Image to Analyze", sources=['upload', 'webcam'], type='pil'),
|
419 |
gr.Slider(0.0, 1.0, value=0.7, step=0.05, label="Confidence Threshold"),
|
|
|
204 |
"Label": f"Error: {str(e)}"
|
205 |
}
|
206 |
|
207 |
+
def ensemble_prediction(img, confidence_threshold, augment_methods, rotate_degrees, noise_level, sharpen_strength):
|
208 |
"""Full ensemble prediction pipeline.
|
209 |
|
210 |
Args:
|
|
|
413 |
|
414 |
|
415 |
detection_model_eval_playground = gr.Interface(
|
416 |
+
fn=ensemble_prediction,
|
417 |
inputs=[
|
418 |
gr.Image(label="Upload Image to Analyze", sources=['upload', 'webcam'], type='pil'),
|
419 |
gr.Slider(0.0, 1.0, value=0.7, step=0.05, label="Confidence Threshold"),
|
requirements.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
--index-url https://download.pytorch.org/whl/cu118
|
2 |
# Core ML/AI libraries
|
3 |
-
transformers
|
4 |
torch
|
5 |
torchvision
|
6 |
torchaudio
|
|
|
1 |
--index-url https://download.pytorch.org/whl/cu118
|
2 |
# Core ML/AI libraries
|
3 |
+
git+https://github.com/huggingface/transformers.git
|
4 |
torch
|
5 |
torchvision
|
6 |
torchaudio
|