Spaces:
Running
on
A10G
Running
on
A10G
Update evaluate.py
Browse files- evaluate.py +23 -8
evaluate.py
CHANGED
@@ -254,11 +254,26 @@ def eval(test, standard, tmpdir):
|
|
254 |
return sum(scores) / len(scores), final_merged_intervals, comments
|
255 |
|
256 |
def install():
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
return sum(scores) / len(scores), final_merged_intervals, comments
|
255 |
|
256 |
def install():
|
257 |
+
import torch
|
258 |
+
if torch.cuda.is_available():
|
259 |
+
cu_version = torch.version.cuda
|
260 |
+
cu_version = f"cu{cu_version.replace('.', '')}" # Format it as 'cuXX' (e.g., 'cu113')
|
261 |
+
else:
|
262 |
+
cu_version = "cpu" # Fallback to CPU if no CUDA is available
|
263 |
+
|
264 |
+
torch_version = torch.__version__.split('+')[0] # Get PyTorch version without build info
|
265 |
+
|
266 |
+
pip_command = f'pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html'
|
267 |
+
|
268 |
+
print("Executing command:", pip_command)
|
269 |
+
|
270 |
+
# # Execute the command using os.system
|
271 |
+
# os.system(pip_command)
|
272 |
+
|
273 |
+
# os.system('mim install mmengine')
|
274 |
+
# # os.system('mim install "mmcv>=2.0.1"')
|
275 |
+
# os.system('mim install "mmdet>=3.1.0"')
|
276 |
+
# os.system('git clone https://github.com/open-mmlab/mmpose.git')
|
277 |
+
# os.chdir('mmpose')
|
278 |
+
# os.system('pip install -r requirements.txt')
|
279 |
+
# os.system('pip install -v -e .')
|