Update app.py
Browse files
app.py
CHANGED
@@ -45,6 +45,9 @@ class WebSearchTool(Tool):
|
|
45 |
return f"Web search failed: {e}"
|
46 |
|
47 |
class VideoAnalyzerTool(Tool):
|
|
|
|
|
|
|
48 |
def __init__(self):
|
49 |
self.image_classifier = ImageClassifierTool()
|
50 |
|
@@ -79,6 +82,9 @@ import cv2
|
|
79 |
import os
|
80 |
|
81 |
class ImageClassifierTool(Tool):
|
|
|
|
|
|
|
82 |
def __init__(self):
|
83 |
self.model = ViTForImageClassification.from_pretrained("google/vit-base-patch16-224")
|
84 |
self.feature_extractor = ViTFeatureExtractor.from_pretrained("google/vit-base-patch16-224")
|
|
|
45 |
return f"Web search failed: {e}"
|
46 |
|
47 |
class VideoAnalyzerTool(Tool):
|
48 |
+
name = "video_analyzer"
|
49 |
+
description = "Analyzes frames from a video using image classification."
|
50 |
+
|
51 |
def __init__(self):
|
52 |
self.image_classifier = ImageClassifierTool()
|
53 |
|
|
|
82 |
import os
|
83 |
|
84 |
class ImageClassifierTool(Tool):
|
85 |
+
name = "image_classifier"
|
86 |
+
description = "Classifies images using ViT."
|
87 |
+
|
88 |
def __init__(self):
|
89 |
self.model = ViTForImageClassification.from_pretrained("google/vit-base-patch16-224")
|
90 |
self.feature_extractor = ViTFeatureExtractor.from_pretrained("google/vit-base-patch16-224")
|