Eliminate set() to avoid set() + list() op (#14745)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
91218583d3
commit
82c4bdad10
1 changed files with 1 additions and 1 deletions
|
|
@ -2221,7 +2221,7 @@ class RandomLoadText:
|
|||
pos_labels = np.unique(cls).tolist()
|
||||
|
||||
if len(pos_labels) > self.max_samples:
|
||||
pos_labels = set(random.sample(pos_labels, k=self.max_samples))
|
||||
pos_labels = random.sample(pos_labels, k=self.max_samples)
|
||||
|
||||
neg_samples = min(min(num_classes, self.max_samples) - len(pos_labels), random.randint(*self.neg_samples))
|
||||
neg_labels = [i for i in range(num_classes) if i not in pos_labels]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue