From 802347f4d8def37ccb9ba8ce7f7b0d9500dc3ff2 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 7 Jun 2023 11:47:34 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20cleanup=20before=20`supervision`?= =?UTF-8?q?=20`0.9.0`=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/image.md | 3 --- docs/notebook/utils.md | 7 ------- docs/utils/file.md | 3 +++ docs/utils/image.md | 3 +++ docs/utils/notebook.md | 7 +++++++ docs/utils/video.md | 15 +++++++++++++++ docs/video.md | 15 --------------- mkdocs.yml | 11 +++++------ supervision/__init__.py | 10 +++++----- supervision/dataset/core.py | 2 +- supervision/dataset/formats/yolo.py | 6 +++++- supervision/detection/core.py | 2 +- supervision/{notebook => utils}/__init__.py | 0 supervision/{ => utils}/file.py | 6 +++--- supervision/{ => utils}/image.py | 0 supervision/{ => utils}/internal.py | 0 .../{notebook/utils.py => utils/notebook.py} | 0 supervision/{ => utils}/video.py | 0 18 files changed, 48 insertions(+), 42 deletions(-) delete mode 100644 docs/image.md delete mode 100644 docs/notebook/utils.md create mode 100644 docs/utils/file.md create mode 100644 docs/utils/image.md create mode 100644 docs/utils/notebook.md create mode 100644 docs/utils/video.md delete mode 100644 docs/video.md rename supervision/{notebook => utils}/__init__.py (100%) rename supervision/{ => utils}/file.py (88%) rename supervision/{ => utils}/image.py (100%) rename supervision/{ => utils}/internal.py (100%) rename supervision/{notebook/utils.py => utils/notebook.py} (100%) rename supervision/{ => utils}/video.py (100%) diff --git a/docs/image.md b/docs/image.md deleted file mode 100644 index cd2e6ae0..00000000 --- a/docs/image.md +++ /dev/null @@ -1,3 +0,0 @@ -## ImageSink - -:::supervision.image.ImageSink \ No newline at end of file diff --git a/docs/notebook/utils.md b/docs/notebook/utils.md deleted file mode 100644 index 5ec1b4f1..00000000 --- a/docs/notebook/utils.md +++ /dev/null @@ -1,7 +0,0 @@ -## plot_image - -:::supervision.notebook.utils.plot_image - -## plot_images_grid - -:::supervision.notebook.utils.plot_images_grid \ No newline at end of file diff --git a/docs/utils/file.md b/docs/utils/file.md new file mode 100644 index 00000000..f7c785a0 --- /dev/null +++ b/docs/utils/file.md @@ -0,0 +1,3 @@ +## list_files_with_extensions + +:::supervision.utils.file.list_files_with_extensions diff --git a/docs/utils/image.md b/docs/utils/image.md new file mode 100644 index 00000000..99b8b9b0 --- /dev/null +++ b/docs/utils/image.md @@ -0,0 +1,3 @@ +## ImageSink + +:::supervision.utils.image.ImageSink \ No newline at end of file diff --git a/docs/utils/notebook.md b/docs/utils/notebook.md new file mode 100644 index 00000000..9cb296b6 --- /dev/null +++ b/docs/utils/notebook.md @@ -0,0 +1,7 @@ +## plot_image + +:::supervision.utils.notebook.plot_image + +## plot_images_grid + +:::supervision.utils.notebook.plot_images_grid \ No newline at end of file diff --git a/docs/utils/video.md b/docs/utils/video.md new file mode 100644 index 00000000..8415fcbb --- /dev/null +++ b/docs/utils/video.md @@ -0,0 +1,15 @@ +## VideoInfo + +:::supervision.utils.video.VideoInfo + +## VideoSink + +:::supervision.utils.video.VideoSink + +## get_video_frames_generator + +:::supervision.utils.video.get_video_frames_generator + +## process_video + +:::supervision.utils.video.process_video \ No newline at end of file diff --git a/docs/video.md b/docs/video.md deleted file mode 100644 index baf61541..00000000 --- a/docs/video.md +++ /dev/null @@ -1,15 +0,0 @@ -## VideoInfo - -:::supervision.video.VideoInfo - -## VideoSink - -:::supervision.video.VideoSink - -## get_video_frames_generator - -:::supervision.video.get_video_frames_generator - -## process_video - -:::supervision.video.process_video \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 641dfb15..579661ae 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -39,12 +39,11 @@ nav: - Core: dataset/core.md - Draw: - Utils: draw/utils.md - - Notebook: - - Utils: notebook/utils.md - - Video: - - Utils: video.md - - Image: - - Utils: image.md + - Utils: + - Video: utils/video.md + - Image: utils/image.md + - Notebook: utils/notebook.md + - File: utils/file.md - Changelog: changelog.md theme: diff --git a/supervision/__init__.py b/supervision/__init__.py index 4177739c..f0e7cca8 100644 --- a/supervision/__init__.py +++ b/supervision/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.8.0" +__version__ = "0.9.0" from supervision.dataset.core import BaseDataset, DetectionDataset from supervision.detection.annotate import BoxAnnotator, MaskAnnotator @@ -16,12 +16,12 @@ from supervision.detection.utils import ( ) from supervision.draw.color import Color, ColorPalette from supervision.draw.utils import draw_filled_rectangle, draw_polygon, draw_text -from supervision.file import list_files_with_extensions from supervision.geometry.core import Point, Position, Rect from supervision.geometry.utils import get_polygon_center -from supervision.image import ImageSink -from supervision.notebook.utils import plot_image, plot_images_grid -from supervision.video import ( +from supervision.utils.file import list_files_with_extensions +from supervision.utils.image import ImageSink +from supervision.utils.notebook import plot_image, plot_images_grid +from supervision.utils.video import ( VideoInfo, VideoSink, get_video_frames_generator, diff --git a/supervision/dataset/core.py b/supervision/dataset/core.py index 23634699..e3fe40e4 100644 --- a/supervision/dataset/core.py +++ b/supervision/dataset/core.py @@ -19,7 +19,7 @@ from supervision.dataset.formats.yolo import ( ) from supervision.dataset.ultils import save_dataset_images, train_test_split from supervision.detection.core import Detections -from supervision.file import list_files_with_extensions +from supervision.utils.file import list_files_with_extensions @dataclass diff --git a/supervision/dataset/formats/yolo.py b/supervision/dataset/formats/yolo.py index a9b75ac5..084649db 100644 --- a/supervision/dataset/formats/yolo.py +++ b/supervision/dataset/formats/yolo.py @@ -9,7 +9,11 @@ import yaml from supervision.dataset.ultils import approximate_mask_with_polygons from supervision.detection.core import Detections from supervision.detection.utils import polygon_to_mask, polygon_to_xyxy -from supervision.file import list_files_with_extensions, read_txt_file, save_text_file +from supervision.utils.file import ( + list_files_with_extensions, + read_txt_file, + save_text_file, +) def _parse_box(values: List[str]) -> np.ndarray: diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 415185f2..a88f8463 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -12,7 +12,7 @@ from supervision.detection.utils import ( xywh_to_xyxy, ) from supervision.geometry.core import Position -from supervision.internal import deprecated +from supervision.utils.internal import deprecated def _validate_xyxy(xyxy: Any, n: int) -> None: diff --git a/supervision/notebook/__init__.py b/supervision/utils/__init__.py similarity index 100% rename from supervision/notebook/__init__.py rename to supervision/utils/__init__.py diff --git a/supervision/file.py b/supervision/utils/file.py similarity index 88% rename from supervision/file.py rename to supervision/utils/file.py index af2ffc79..c24af4f8 100644 --- a/supervision/file.py +++ b/supervision/utils/file.py @@ -17,13 +17,13 @@ def list_files_with_extensions( Examples: ```python - >>> from supervision import list_files_with_extensions + >>> import supervision as sv >>> # List all files in the directory - >>> files = list_files_with_extensions(directory='my_directory') + >>> files = sv.list_files_with_extensions(directory='my_directory') >>> # List only files with '.txt' and '.md' extensions - >>> files = list_files_with_extensions(directory='my_directory', extensions=['txt', 'md']) + >>> files = sv.list_files_with_extensions(directory='my_directory', extensions=['txt', 'md']) ``` """ directory = Path(directory) diff --git a/supervision/image.py b/supervision/utils/image.py similarity index 100% rename from supervision/image.py rename to supervision/utils/image.py diff --git a/supervision/internal.py b/supervision/utils/internal.py similarity index 100% rename from supervision/internal.py rename to supervision/utils/internal.py diff --git a/supervision/notebook/utils.py b/supervision/utils/notebook.py similarity index 100% rename from supervision/notebook/utils.py rename to supervision/utils/notebook.py diff --git a/supervision/video.py b/supervision/utils/video.py similarity index 100% rename from supervision/video.py rename to supervision/utils/video.py