Upload folder using huggingface_hub
Browse files
miner.py
CHANGED
|
@@ -211,14 +211,14 @@ class Miner:
|
|
| 211 |
print(self.player_batch_size)
|
| 212 |
if 'out of memory' in str(e):
|
| 213 |
if self.player_batch_size == 1:
|
| 214 |
-
|
| 215 |
self.player_batch_size = self.player_batch_size // 2 if self.player_batch_size > 1 else 1
|
| 216 |
player_batch_size = min(self.player_batch_size, len(batch_images))
|
| 217 |
else:
|
| 218 |
-
|
| 219 |
except Exception as e:
|
| 220 |
print(f"❌ Error during bbox prediction: {e}")
|
| 221 |
-
|
| 222 |
|
| 223 |
pitch_batch_size = min(self.pitch_batch_size, len(batch_images))
|
| 224 |
keypoints: dict[int, list[tuple[int, int]]] = {}
|
|
@@ -284,14 +284,14 @@ class Miner:
|
|
| 284 |
print(self.pitch_batch_size)
|
| 285 |
if 'out of memory' in str(e):
|
| 286 |
if self.pitch_batch_size == 1:
|
| 287 |
-
|
| 288 |
self.pitch_batch_size = self.pitch_batch_size // 2 if self.pitch_batch_size > 1 else 1
|
| 289 |
pitch_batch_size = min(self.pitch_batch_size, len(batch_images))
|
| 290 |
else:
|
| 291 |
-
|
| 292 |
except Exception as e:
|
| 293 |
print(f"❌ Error during keypoints prediction: {e}")
|
| 294 |
-
|
| 295 |
|
| 296 |
# Combine results
|
| 297 |
results: list[TVFrameResult] = []
|
|
|
|
| 211 |
print(self.player_batch_size)
|
| 212 |
if 'out of memory' in str(e):
|
| 213 |
if self.player_batch_size == 1:
|
| 214 |
+
break
|
| 215 |
self.player_batch_size = self.player_batch_size // 2 if self.player_batch_size > 1 else 1
|
| 216 |
player_batch_size = min(self.player_batch_size, len(batch_images))
|
| 217 |
else:
|
| 218 |
+
break
|
| 219 |
except Exception as e:
|
| 220 |
print(f"❌ Error during bbox prediction: {e}")
|
| 221 |
+
break
|
| 222 |
|
| 223 |
pitch_batch_size = min(self.pitch_batch_size, len(batch_images))
|
| 224 |
keypoints: dict[int, list[tuple[int, int]]] = {}
|
|
|
|
| 284 |
print(self.pitch_batch_size)
|
| 285 |
if 'out of memory' in str(e):
|
| 286 |
if self.pitch_batch_size == 1:
|
| 287 |
+
break
|
| 288 |
self.pitch_batch_size = self.pitch_batch_size // 2 if self.pitch_batch_size > 1 else 1
|
| 289 |
pitch_batch_size = min(self.pitch_batch_size, len(batch_images))
|
| 290 |
else:
|
| 291 |
+
break
|
| 292 |
except Exception as e:
|
| 293 |
print(f"❌ Error during keypoints prediction: {e}")
|
| 294 |
+
break
|
| 295 |
|
| 296 |
# Combine results
|
| 297 |
results: list[TVFrameResult] = []
|