gloriforge commited on
Commit
de651d3
·
verified ·
1 Parent(s): 9e8231e

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. miner.py +6 -6
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
- raise e
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
- raise e
219
  except Exception as e:
220
  print(f"❌ Error during bbox prediction: {e}")
221
- raise e
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
- raise e
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
- raise e
292
  except Exception as e:
293
  print(f"❌ Error during keypoints prediction: {e}")
294
- raise e
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] = []