PEP660 support for `pip install -e .` (#9851)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
main
Glenn Jocher 5 months ago committed by GitHub
parent 9b7a0c82fd
commit 5e3da9bbf9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      pyproject.toml
  2. 4
      ultralytics/data/base.py
  3. 1
      ultralytics/data/dataset.py

@ -19,7 +19,7 @@
# For comprehensive documentation and usage instructions, visit: https://docs.ultralytics.com
[build-system]
requires = ["setuptools>=43.0.0", "wheel"]
requires = ["setuptools>=57.0.0", "wheel"]
build-backend = "setuptools.build_meta"
# Project settings -----------------------------------------------------------------------------------------------------

@ -122,9 +122,7 @@ class BaseDataset(Dataset):
except Exception as e:
raise FileNotFoundError(f"{self.prefix}Error loading data from {img_path}\n{HELP_URL}") from e
if self.fraction < 1:
# im_files = im_files[: round(len(im_files) * self.fraction)]
num_elements_to_select = round(len(im_files) * self.fraction)
im_files = random.sample(im_files, num_elements_to_select)
im_files = im_files[: round(len(im_files) * self.fraction)] # retain a fraction of the dataset
return im_files
def update_labels(self, include_class: Optional[list]):

@ -1,4 +1,5 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
import contextlib
import json
from collections import defaultdict

Loading…
Cancel
Save