AZIIIIIIIIZ commited on
Commit
a07763e
·
verified ·
1 Parent(s): 58eeefc

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -76,7 +76,11 @@ class SimpleVideoAnalyzer:
76
 
77
  # Simple similarity-based prediction
78
  # In a real implementation, you'd use a trained classifier
79
- scores = np.random.softmax(np.random.randn(len(self.action_categories)))
 
 
 
 
80
 
81
  # Get top 5 predictions
82
  top_indices = np.argsort(scores)[-5:][::-1]
 
76
 
77
  # Simple similarity-based prediction
78
  # In a real implementation, you'd use a trained classifier
79
+ # Generate random scores and apply softmax manually
80
+ raw_scores = np.random.randn(len(self.action_categories))
81
+ # Manual softmax implementation
82
+ exp_scores = np.exp(raw_scores - np.max(raw_scores)) # Subtract max for numerical stability
83
+ scores = exp_scores / np.sum(exp_scores)
84
 
85
  # Get top 5 predictions
86
  top_indices = np.argsort(scores)[-5:][::-1]