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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/9828/head^2
Glenn Jocher 8 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 # For comprehensive documentation and usage instructions, visit: https://docs.ultralytics.com
[build-system] [build-system]
requires = ["setuptools>=43.0.0", "wheel"] requires = ["setuptools>=57.0.0", "wheel"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
# Project settings ----------------------------------------------------------------------------------------------------- # Project settings -----------------------------------------------------------------------------------------------------

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

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

Loading…
Cancel
Save