Skip to content

Commit

Permalink
optimized deleteSimilarDetections
Browse files Browse the repository at this point in the history
  • Loading branch information
PandapowrTR authored Feb 4, 2024
1 parent 4f6f1b2 commit 1c3330a
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions Data/Dominate/DominateLabeledImage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, shutil, os, gc, threading, time, sys, uuid, copy, cv2, warnings
import os, shutil, os, gc, time, sys, uuid, copy, cv2, warnings
import concurrent.futures

warnings.warn("ignore")
Expand Down Expand Up @@ -205,16 +205,6 @@ def deleteSimilarDetections(
int: The number of deleted similar detection files.
"""

def chunkList(lst, numChunks):
avgShunkSize = len(lst) // numChunks
remainder = len(lst) % numChunks
start = 0

for i in range(numChunks):
end = start + avgShunkSize + (1 if i < remainder else 0)
yield lst[start:end]
start = end

def processFile(args):
(
file,
Expand Down Expand Up @@ -287,7 +277,7 @@ def processFile(args):
deletedFiles.append(checkFile)
os.remove(checkCutDetection)
break

os.remove(checkCutDetection)
os.remove(cutDetection)

imgHeight = 0
Expand Down

0 comments on commit 1c3330a

Please sign in to comment.