Spaces:
Runtime error
Runtime error
Commit ·
c134ff4
1
Parent(s): d22ea40
add zerogpu
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import os
|
|
| 5 |
import cv2
|
| 6 |
import uuid
|
| 7 |
import time
|
|
|
|
| 8 |
import subprocess
|
| 9 |
import matplotlib
|
| 10 |
matplotlib.use('Agg')
|
|
@@ -59,6 +60,7 @@ def sigmoid(x):
|
|
| 59 |
return 1 / (1 + np.exp(-x))
|
| 60 |
|
| 61 |
|
|
|
|
| 62 |
def inference(x, count_only_api, api_key, img_size=224, seq_len=64, stride_length=32, stride_pad=3, batch_size=4, miss_threshold=0.8, marks_threshold=0.6, median_pred_filter=True, center_crop=True, both_feet=True, api_call=False):
|
| 63 |
print(x)
|
| 64 |
#api = HfApi(token=os.environ['DATASET_SECRET'])
|
|
|
|
| 5 |
import cv2
|
| 6 |
import uuid
|
| 7 |
import time
|
| 8 |
+
import spaces
|
| 9 |
import subprocess
|
| 10 |
import matplotlib
|
| 11 |
matplotlib.use('Agg')
|
|
|
|
| 60 |
return 1 / (1 + np.exp(-x))
|
| 61 |
|
| 62 |
|
| 63 |
+
@spaces.GPU(duration=180)
|
| 64 |
def inference(x, count_only_api, api_key, img_size=224, seq_len=64, stride_length=32, stride_pad=3, batch_size=4, miss_threshold=0.8, marks_threshold=0.6, median_pred_filter=True, center_crop=True, both_feet=True, api_call=False):
|
| 65 |
print(x)
|
| 66 |
#api = HfApi(token=os.environ['DATASET_SECRET'])
|