ultralytics 8.2.21__py3-none-any.whl → 8.2.23__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ultralytics might be problematic. Click here for more details.
- tests/test_cli.py +1 -2
- tests/test_cuda.py +3 -4
- tests/test_engine.py +1 -2
- tests/test_exports.py +1 -1
- tests/test_integrations.py +1 -2
- tests/test_python.py +4 -7
- ultralytics/__init__.py +1 -1
- ultralytics/data/augment.py +67 -10
- ultralytics/data/loaders.py +24 -7
- ultralytics/data/utils.py +1 -1
- ultralytics/solutions/__init__.py +1 -1
- ultralytics/solutions/analytics.py +4 -2
- ultralytics/solutions/parking_management.py +24 -20
- {ultralytics-8.2.21.dist-info → ultralytics-8.2.23.dist-info}/METADATA +4 -2
- {ultralytics-8.2.21.dist-info → ultralytics-8.2.23.dist-info}/RECORD +19 -19
- {ultralytics-8.2.21.dist-info → ultralytics-8.2.23.dist-info}/LICENSE +0 -0
- {ultralytics-8.2.21.dist-info → ultralytics-8.2.23.dist-info}/WHEEL +0 -0
- {ultralytics-8.2.21.dist-info → ultralytics-8.2.23.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.2.21.dist-info → ultralytics-8.2.23.dist-info}/top_level.txt +0 -0
tests/test_cli.py
CHANGED
|
@@ -4,11 +4,10 @@ import subprocess
|
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
6
|
|
|
7
|
+
from tests import CUDA_DEVICE_COUNT, CUDA_IS_AVAILABLE
|
|
7
8
|
from ultralytics.cfg import TASK2DATA, TASK2MODEL, TASKS
|
|
8
9
|
from ultralytics.utils import ASSETS, WEIGHTS_DIR, checks
|
|
9
10
|
|
|
10
|
-
from tests import CUDA_DEVICE_COUNT, CUDA_IS_AVAILABLE
|
|
11
|
-
|
|
12
11
|
# Constants
|
|
13
12
|
TASK_MODEL_DATA = [(task, WEIGHTS_DIR / TASK2MODEL[task], TASK2DATA[task]) for task in TASKS]
|
|
14
13
|
MODELS = [WEIGHTS_DIR / TASK2MODEL[task] for task in TASKS]
|
tests/test_cuda.py
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
|
2
2
|
|
|
3
|
-
from pathlib import Path
|
|
4
3
|
from itertools import product
|
|
4
|
+
from pathlib import Path
|
|
5
5
|
|
|
6
6
|
import pytest
|
|
7
7
|
import torch
|
|
8
8
|
|
|
9
|
+
from tests import CUDA_DEVICE_COUNT, CUDA_IS_AVAILABLE, MODEL, SOURCE
|
|
9
10
|
from ultralytics import YOLO
|
|
10
|
-
from ultralytics.utils import ASSETS, WEIGHTS_DIR
|
|
11
11
|
from ultralytics.cfg import TASK2DATA, TASK2MODEL, TASKS
|
|
12
|
-
|
|
13
|
-
from tests import CUDA_DEVICE_COUNT, CUDA_IS_AVAILABLE, MODEL, SOURCE
|
|
12
|
+
from ultralytics.utils import ASSETS, WEIGHTS_DIR
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
def test_checks():
|
tests/test_engine.py
CHANGED
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
import sys
|
|
4
4
|
from unittest import mock
|
|
5
5
|
|
|
6
|
+
from tests import MODEL
|
|
6
7
|
from ultralytics import YOLO
|
|
7
8
|
from ultralytics.cfg import get_cfg
|
|
8
9
|
from ultralytics.engine.exporter import Exporter
|
|
9
10
|
from ultralytics.models.yolo import classify, detect, segment
|
|
10
11
|
from ultralytics.utils import ASSETS, DEFAULT_CFG, WEIGHTS_DIR
|
|
11
12
|
|
|
12
|
-
from tests import MODEL
|
|
13
|
-
|
|
14
13
|
|
|
15
14
|
def test_func(*args): # noqa
|
|
16
15
|
"""Test function callback."""
|
tests/test_exports.py
CHANGED
|
@@ -7,6 +7,7 @@ from pathlib import Path
|
|
|
7
7
|
|
|
8
8
|
import pytest
|
|
9
9
|
|
|
10
|
+
from tests import MODEL, SOURCE
|
|
10
11
|
from ultralytics import YOLO
|
|
11
12
|
from ultralytics.cfg import TASK2DATA, TASK2MODEL, TASKS
|
|
12
13
|
from ultralytics.utils import (
|
|
@@ -18,7 +19,6 @@ from ultralytics.utils import (
|
|
|
18
19
|
checks,
|
|
19
20
|
)
|
|
20
21
|
from ultralytics.utils.torch_utils import TORCH_1_9, TORCH_1_13
|
|
21
|
-
from tests import MODEL, SOURCE
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def test_export_torchscript():
|
tests/test_integrations.py
CHANGED
|
@@ -8,12 +8,11 @@ from pathlib import Path
|
|
|
8
8
|
|
|
9
9
|
import pytest
|
|
10
10
|
|
|
11
|
+
from tests import MODEL, SOURCE, TMP
|
|
11
12
|
from ultralytics import YOLO, download
|
|
12
13
|
from ultralytics.utils import DATASETS_DIR, SETTINGS
|
|
13
14
|
from ultralytics.utils.checks import check_requirements
|
|
14
15
|
|
|
15
|
-
from tests import MODEL, SOURCE, TMP
|
|
16
|
-
|
|
17
16
|
|
|
18
17
|
@pytest.mark.skipif(not check_requirements("ray", install=False), reason="ray[tune] not installed")
|
|
19
18
|
def test_model_ray_tune():
|
tests/test_python.py
CHANGED
|
@@ -11,8 +11,9 @@ import torch
|
|
|
11
11
|
import yaml
|
|
12
12
|
from PIL import Image
|
|
13
13
|
|
|
14
|
+
from tests import CFG, IS_TMP_WRITEABLE, MODEL, SOURCE, TMP
|
|
14
15
|
from ultralytics import RTDETR, YOLO
|
|
15
|
-
from ultralytics.cfg import MODELS,
|
|
16
|
+
from ultralytics.cfg import MODELS, TASK2DATA, TASKS
|
|
16
17
|
from ultralytics.data.build import load_inference_source
|
|
17
18
|
from ultralytics.utils import (
|
|
18
19
|
ASSETS,
|
|
@@ -22,12 +23,10 @@ from ultralytics.utils import (
|
|
|
22
23
|
ROOT,
|
|
23
24
|
WEIGHTS_DIR,
|
|
24
25
|
WINDOWS,
|
|
25
|
-
Retry,
|
|
26
26
|
checks,
|
|
27
27
|
)
|
|
28
|
-
from ultralytics.utils.downloads import download
|
|
28
|
+
from ultralytics.utils.downloads import download
|
|
29
29
|
from ultralytics.utils.torch_utils import TORCH_1_9
|
|
30
|
-
from tests import CFG, IS_TMP_WRITEABLE, MODEL, SOURCE, TMP
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
def test_model_forward():
|
|
@@ -130,13 +129,11 @@ def test_predict_grey_and_4ch():
|
|
|
130
129
|
|
|
131
130
|
@pytest.mark.slow
|
|
132
131
|
@pytest.mark.skipif(not ONLINE, reason="environment is offline")
|
|
133
|
-
@pytest.mark.skipif(not is_url("https://youtu.be/G17sBkb38XQ"), reason="YouTube URL issue")
|
|
134
|
-
@Retry(times=3, delay=10)
|
|
135
132
|
def test_youtube():
|
|
136
133
|
"""
|
|
137
134
|
Test YouTube inference.
|
|
138
135
|
|
|
139
|
-
|
|
136
|
+
Note: ConnectionError may occur during this test due to network instability or YouTube server availability.
|
|
140
137
|
"""
|
|
141
138
|
model = YOLO(MODEL)
|
|
142
139
|
model.predict("https://youtu.be/G17sBkb38XQ", imgsz=96, save=True)
|
ultralytics/__init__.py
CHANGED
ultralytics/data/augment.py
CHANGED
|
@@ -874,11 +874,56 @@ class Albumentations:
|
|
|
874
874
|
self.p = p
|
|
875
875
|
self.transform = None
|
|
876
876
|
prefix = colorstr("albumentations: ")
|
|
877
|
+
|
|
877
878
|
try:
|
|
878
879
|
import albumentations as A
|
|
879
880
|
|
|
880
881
|
check_version(A.__version__, "1.0.3", hard=True) # version requirement
|
|
881
882
|
|
|
883
|
+
# List of possible spatial transforms
|
|
884
|
+
spatial_transforms = {
|
|
885
|
+
"Affine",
|
|
886
|
+
"BBoxSafeRandomCrop",
|
|
887
|
+
"CenterCrop",
|
|
888
|
+
"CoarseDropout",
|
|
889
|
+
"Crop",
|
|
890
|
+
"CropAndPad",
|
|
891
|
+
"CropNonEmptyMaskIfExists",
|
|
892
|
+
"D4",
|
|
893
|
+
"ElasticTransform",
|
|
894
|
+
"Flip",
|
|
895
|
+
"GridDistortion",
|
|
896
|
+
"GridDropout",
|
|
897
|
+
"HorizontalFlip",
|
|
898
|
+
"Lambda",
|
|
899
|
+
"LongestMaxSize",
|
|
900
|
+
"MaskDropout",
|
|
901
|
+
"MixUp",
|
|
902
|
+
"Morphological",
|
|
903
|
+
"NoOp",
|
|
904
|
+
"OpticalDistortion",
|
|
905
|
+
"PadIfNeeded",
|
|
906
|
+
"Perspective",
|
|
907
|
+
"PiecewiseAffine",
|
|
908
|
+
"PixelDropout",
|
|
909
|
+
"RandomCrop",
|
|
910
|
+
"RandomCropFromBorders",
|
|
911
|
+
"RandomGridShuffle",
|
|
912
|
+
"RandomResizedCrop",
|
|
913
|
+
"RandomRotate90",
|
|
914
|
+
"RandomScale",
|
|
915
|
+
"RandomSizedBBoxSafeCrop",
|
|
916
|
+
"RandomSizedCrop",
|
|
917
|
+
"Resize",
|
|
918
|
+
"Rotate",
|
|
919
|
+
"SafeRotate",
|
|
920
|
+
"ShiftScaleRotate",
|
|
921
|
+
"SmallestMaxSize",
|
|
922
|
+
"Transpose",
|
|
923
|
+
"VerticalFlip",
|
|
924
|
+
"XYMasking",
|
|
925
|
+
} # from https://albumentations.ai/docs/getting_started/transforms_and_targets/#spatial-level-transforms
|
|
926
|
+
|
|
882
927
|
# Transforms
|
|
883
928
|
T = [
|
|
884
929
|
A.Blur(p=0.01),
|
|
@@ -889,8 +934,14 @@ class Albumentations:
|
|
|
889
934
|
A.RandomGamma(p=0.0),
|
|
890
935
|
A.ImageCompression(quality_lower=75, p=0.0),
|
|
891
936
|
]
|
|
892
|
-
self.transform = A.Compose(T, bbox_params=A.BboxParams(format="yolo", label_fields=["class_labels"]))
|
|
893
937
|
|
|
938
|
+
# Compose transforms
|
|
939
|
+
self.contains_spatial = any(transform.__class__.__name__ in spatial_transforms for transform in T)
|
|
940
|
+
self.transform = (
|
|
941
|
+
A.Compose(T, bbox_params=A.BboxParams(format="yolo", label_fields=["class_labels"]))
|
|
942
|
+
if self.contains_spatial
|
|
943
|
+
else A.Compose(T)
|
|
944
|
+
)
|
|
894
945
|
LOGGER.info(prefix + ", ".join(f"{x}".replace("always_apply=False, ", "") for x in T if x.p))
|
|
895
946
|
except ImportError: # package not installed, skip
|
|
896
947
|
pass
|
|
@@ -899,20 +950,26 @@ class Albumentations:
|
|
|
899
950
|
|
|
900
951
|
def __call__(self, labels):
|
|
901
952
|
"""Generates object detections and returns a dictionary with detection results."""
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
labels["
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
953
|
+
if self.transform is None or random.random() > self.p:
|
|
954
|
+
return labels
|
|
955
|
+
|
|
956
|
+
if self.contains_spatial:
|
|
957
|
+
cls = labels["cls"]
|
|
958
|
+
if len(cls):
|
|
959
|
+
im = labels["img"]
|
|
960
|
+
labels["instances"].convert_bbox("xywh")
|
|
961
|
+
labels["instances"].normalize(*im.shape[:2][::-1])
|
|
962
|
+
bboxes = labels["instances"].bboxes
|
|
963
|
+
# TODO: add supports of segments and keypoints
|
|
910
964
|
new = self.transform(image=im, bboxes=bboxes, class_labels=cls) # transformed
|
|
911
965
|
if len(new["class_labels"]) > 0: # skip update if no bbox in new im
|
|
912
966
|
labels["img"] = new["image"]
|
|
913
967
|
labels["cls"] = np.array(new["class_labels"])
|
|
914
968
|
bboxes = np.array(new["bboxes"], dtype=np.float32)
|
|
915
|
-
|
|
969
|
+
labels["instances"].update(bboxes=bboxes)
|
|
970
|
+
else:
|
|
971
|
+
labels["img"] = self.transform(image=labels["img"])["image"] # transformed
|
|
972
|
+
|
|
916
973
|
return labels
|
|
917
974
|
|
|
918
975
|
|
ultralytics/data/loaders.py
CHANGED
|
@@ -325,7 +325,7 @@ class LoadImagesAndVideos:
|
|
|
325
325
|
paths, imgs, info = [], [], []
|
|
326
326
|
while len(imgs) < self.bs:
|
|
327
327
|
if self.count >= self.nf: # end of file list
|
|
328
|
-
if
|
|
328
|
+
if imgs:
|
|
329
329
|
return paths, imgs, info # return last partial batch
|
|
330
330
|
else:
|
|
331
331
|
raise StopIteration
|
|
@@ -522,26 +522,43 @@ def autocast_list(source):
|
|
|
522
522
|
return files
|
|
523
523
|
|
|
524
524
|
|
|
525
|
-
def get_best_youtube_url(url,
|
|
525
|
+
def get_best_youtube_url(url, method="pytube"):
|
|
526
526
|
"""
|
|
527
527
|
Retrieves the URL of the best quality MP4 video stream from a given YouTube video.
|
|
528
528
|
|
|
529
|
-
This function uses the
|
|
530
|
-
|
|
529
|
+
This function uses the specified method to extract the video info from YouTube. It supports the following methods:
|
|
530
|
+
- "pytube": Uses the pytube library to fetch the video streams.
|
|
531
|
+
- "pafy": Uses the pafy library to fetch the video streams.
|
|
532
|
+
- "yt-dlp": Uses the yt-dlp library to fetch the video streams.
|
|
533
|
+
|
|
534
|
+
The function then finds the highest quality MP4 format that has a video codec but no audio codec, and returns the
|
|
535
|
+
URL of this video stream.
|
|
531
536
|
|
|
532
537
|
Args:
|
|
533
538
|
url (str): The URL of the YouTube video.
|
|
534
|
-
|
|
539
|
+
method (str): The method to use for extracting video info. Default is "pytube". Other options are "pafy" and
|
|
540
|
+
"yt-dlp".
|
|
535
541
|
|
|
536
542
|
Returns:
|
|
537
543
|
(str): The URL of the best quality MP4 video stream, or None if no suitable stream is found.
|
|
538
544
|
"""
|
|
539
|
-
if
|
|
545
|
+
if method == "pytube":
|
|
546
|
+
check_requirements("pytube")
|
|
547
|
+
from pytube import YouTube
|
|
548
|
+
|
|
549
|
+
streams = YouTube(url).streams.filter(file_extension="mp4", only_video=True)
|
|
550
|
+
streams = sorted(streams, key=lambda s: s.resolution, reverse=True) # sort streams by resolution
|
|
551
|
+
for stream in streams:
|
|
552
|
+
if stream.resolution and int(stream.resolution[:-1]) >= 1080: # check if resolution is at least 1080p
|
|
553
|
+
return stream.url
|
|
554
|
+
|
|
555
|
+
elif method == "pafy":
|
|
540
556
|
check_requirements(("pafy", "youtube_dl==2020.12.2"))
|
|
541
557
|
import pafy # noqa
|
|
542
558
|
|
|
543
559
|
return pafy.new(url).getbestvideo(preftype="mp4").url
|
|
544
|
-
|
|
560
|
+
|
|
561
|
+
elif method == "yt-dlp":
|
|
545
562
|
check_requirements("yt-dlp")
|
|
546
563
|
import yt_dlp
|
|
547
564
|
|
ultralytics/data/utils.py
CHANGED
|
@@ -35,7 +35,7 @@ from ultralytics.utils.checks import check_file, check_font, is_ascii
|
|
|
35
35
|
from ultralytics.utils.downloads import download, safe_download, unzip_file
|
|
36
36
|
from ultralytics.utils.ops import segments2boxes
|
|
37
37
|
|
|
38
|
-
HELP_URL = "See https://docs.ultralytics.com/datasets
|
|
38
|
+
HELP_URL = "See https://docs.ultralytics.com/datasets for dataset formatting guidance."
|
|
39
39
|
IMG_FORMATS = {"bmp", "dng", "jpeg", "jpg", "mpo", "png", "tif", "tiff", "webp", "pfm"} # image suffixes
|
|
40
40
|
VID_FORMATS = {"asf", "avi", "gif", "m4v", "mkv", "mov", "mp4", "mpeg", "mpg", "ts", "wmv", "webm"} # video suffixes
|
|
41
41
|
PIN_MEMORY = str(os.getenv("PIN_MEMORY", True)).lower() == "true" # global pin_memory for dataloaders
|
|
@@ -5,7 +5,7 @@ from .analytics import Analytics
|
|
|
5
5
|
from .distance_calculation import DistanceCalculation
|
|
6
6
|
from .heatmap import Heatmap
|
|
7
7
|
from .object_counter import ObjectCounter
|
|
8
|
-
from .parking_management import ParkingManagement
|
|
8
|
+
from .parking_management import ParkingManagement, ParkingPtsSelection
|
|
9
9
|
from .queue_management import QueueManager
|
|
10
10
|
from .speed_estimation import SpeedEstimator
|
|
11
11
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
|
2
|
+
|
|
1
3
|
from itertools import cycle
|
|
2
4
|
|
|
3
5
|
import cv2
|
|
@@ -31,7 +33,7 @@ class Analytics:
|
|
|
31
33
|
|
|
32
34
|
Args:
|
|
33
35
|
type (str): Type of chart to initialize ('line', 'bar', or 'pie').
|
|
34
|
-
writer: Video writer object to save the frames.
|
|
36
|
+
writer (object): Video writer object to save the frames.
|
|
35
37
|
im0_shape (tuple): Shape of the input image (width, height).
|
|
36
38
|
title (str): Title of the chart.
|
|
37
39
|
x_label (str): Label for the x-axis.
|
|
@@ -62,7 +64,7 @@ class Analytics:
|
|
|
62
64
|
self.ax = fig.add_subplot(111, facecolor=self.bg_color)
|
|
63
65
|
(self.line,) = self.ax.plot([], [], color=line_color, linewidth=line_width)
|
|
64
66
|
|
|
65
|
-
elif type
|
|
67
|
+
elif type in {"bar", "pie"}:
|
|
66
68
|
# Initialize bar or pie plot
|
|
67
69
|
self.fig, self.ax = plt.subplots(figsize=figsize, facecolor=self.bg_color)
|
|
68
70
|
self.ax.set_facecolor(self.bg_color)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
|
2
|
+
|
|
1
3
|
import json
|
|
2
4
|
from tkinter import filedialog, messagebox
|
|
3
5
|
|
|
@@ -10,32 +12,31 @@ from ultralytics.utils.plotting import Annotator
|
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
class ParkingPtsSelection:
|
|
13
|
-
def __init__(self
|
|
14
|
-
"""
|
|
15
|
-
Initializes the UI for selecting parking zone points in a tkinter window.
|
|
16
|
-
|
|
17
|
-
Args:
|
|
18
|
-
master (tk.Tk): The main tkinter window object.
|
|
19
|
-
"""
|
|
15
|
+
def __init__(self):
|
|
16
|
+
"""Initializes the UI for selecting parking zone points in a tkinter window."""
|
|
20
17
|
check_requirements("tkinter")
|
|
18
|
+
|
|
21
19
|
import tkinter as tk
|
|
22
20
|
|
|
23
|
-
self.
|
|
24
|
-
master.
|
|
21
|
+
self.tk = tk
|
|
22
|
+
self.master = tk.Tk()
|
|
23
|
+
self.master.title("Ultralytics Parking Zones Points Selector")
|
|
25
24
|
|
|
26
25
|
# Disable window resizing
|
|
27
|
-
master.resizable(False, False)
|
|
26
|
+
self.master.resizable(False, False)
|
|
28
27
|
|
|
29
28
|
# Setup canvas for image display
|
|
30
|
-
self.canvas = tk.Canvas(master, bg="white")
|
|
29
|
+
self.canvas = self.tk.Canvas(self.master, bg="white")
|
|
31
30
|
|
|
32
31
|
# Setup buttons
|
|
33
|
-
button_frame = tk.Frame(master)
|
|
34
|
-
button_frame.pack(side=tk.TOP)
|
|
32
|
+
button_frame = self.tk.Frame(self.master)
|
|
33
|
+
button_frame.pack(side=self.tk.TOP)
|
|
35
34
|
|
|
36
|
-
tk.Button(button_frame, text="Upload Image", command=self.upload_image).grid(row=0, column=0)
|
|
37
|
-
tk.Button(button_frame, text="Remove Last BBox", command=self.remove_last_bounding_box).grid(
|
|
38
|
-
|
|
35
|
+
self.tk.Button(button_frame, text="Upload Image", command=self.upload_image).grid(row=0, column=0)
|
|
36
|
+
self.tk.Button(button_frame, text="Remove Last BBox", command=self.remove_last_bounding_box).grid(
|
|
37
|
+
row=0, column=1
|
|
38
|
+
)
|
|
39
|
+
self.tk.Button(button_frame, text="Save", command=self.save_to_json).grid(row=0, column=2)
|
|
39
40
|
|
|
40
41
|
# Initialize properties
|
|
41
42
|
self.image_path = None
|
|
@@ -50,6 +51,8 @@ class ParkingPtsSelection:
|
|
|
50
51
|
self.canvas_max_width = 1280
|
|
51
52
|
self.canvas_max_height = 720
|
|
52
53
|
|
|
54
|
+
self.master.mainloop()
|
|
55
|
+
|
|
53
56
|
def upload_image(self):
|
|
54
57
|
"""Upload an image and resize it to fit canvas."""
|
|
55
58
|
self.image_path = filedialog.askopenfilename(filetypes=[("Image Files", "*.png;*.jpg;*.jpeg")])
|
|
@@ -74,12 +77,12 @@ class ParkingPtsSelection:
|
|
|
74
77
|
if self.canvas:
|
|
75
78
|
self.canvas.destroy() # Destroy previous canvas
|
|
76
79
|
|
|
77
|
-
self.canvas = tk.Canvas(self.master, bg="white", width=canvas_width, height=canvas_height)
|
|
80
|
+
self.canvas = self.tk.Canvas(self.master, bg="white", width=canvas_width, height=canvas_height)
|
|
78
81
|
resized_image = self.image.resize((canvas_width, canvas_height), Image.LANCZOS)
|
|
79
82
|
self.canvas_image = ImageTk.PhotoImage(resized_image)
|
|
80
|
-
self.canvas.create_image(0, 0, anchor=tk.NW, image=self.canvas_image)
|
|
83
|
+
self.canvas.create_image(0, 0, anchor=self.tk.NW, image=self.canvas_image)
|
|
81
84
|
|
|
82
|
-
self.canvas.pack(side=tk.BOTTOM)
|
|
85
|
+
self.canvas.pack(side=self.tk.BOTTOM)
|
|
83
86
|
self.canvas.bind("<Button-1>", self.on_canvas_click)
|
|
84
87
|
|
|
85
88
|
# Reset bounding boxes and current box
|
|
@@ -115,7 +118,7 @@ class ParkingPtsSelection:
|
|
|
115
118
|
if self.bounding_boxes:
|
|
116
119
|
self.bounding_boxes.pop() # Remove the last bounding box
|
|
117
120
|
self.canvas.delete("all") # Clear the canvas
|
|
118
|
-
self.canvas.create_image(0, 0, anchor=tk.NW, image=self.canvas_image) # Redraw the image
|
|
121
|
+
self.canvas.create_image(0, 0, anchor=self.tk.NW, image=self.canvas_image) # Redraw the image
|
|
119
122
|
|
|
120
123
|
# Redraw all bounding boxes
|
|
121
124
|
for box in self.bounding_boxes:
|
|
@@ -210,6 +213,7 @@ class ParkingManagement:
|
|
|
210
213
|
im0 (ndarray): inference image
|
|
211
214
|
boxes (list): bounding boxes data
|
|
212
215
|
clss (list): bounding boxes classes list
|
|
216
|
+
|
|
213
217
|
Returns:
|
|
214
218
|
filled_slots (int): total slots that are filled in parking lot
|
|
215
219
|
empty_slots (int): total slots that are available in parking lot
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ultralytics
|
|
3
|
-
Version: 8.2.
|
|
3
|
+
Version: 8.2.23
|
|
4
4
|
Summary: Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
|
|
5
5
|
Author: Glenn Jocher, Ayush Chaurasia, Jing Qiu
|
|
6
6
|
Maintainer: Glenn Jocher, Ayush Chaurasia, Jing Qiu
|
|
@@ -135,7 +135,7 @@ See below for a quickstart installation and usage example, and see the [YOLOv8 D
|
|
|
135
135
|
|
|
136
136
|
Pip install the ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
|
|
137
137
|
|
|
138
|
-
[](https://pypi.org/project/ultralytics/) [](https://pepy.tech/project/ultralytics) [](https://pypi.org/project/ultralytics/)
|
|
139
139
|
|
|
140
140
|
```bash
|
|
141
141
|
pip install ultralytics
|
|
@@ -143,6 +143,8 @@ pip install ultralytics
|
|
|
143
143
|
|
|
144
144
|
For alternative installation methods including [Conda](https://anaconda.org/conda-forge/ultralytics), [Docker](https://hub.docker.com/r/ultralytics/ultralytics), and Git, please refer to the [Quickstart Guide](https://docs.ultralytics.com/quickstart).
|
|
145
145
|
|
|
146
|
+
[](https://anaconda.org/conda-forge/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics)
|
|
147
|
+
|
|
146
148
|
</details>
|
|
147
149
|
|
|
148
150
|
<details open>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
tests/__init__.py,sha256=9evx3lOdKZeY1iWXvH-FkMkgf8jLucWICoabzeD6aYg,626
|
|
2
2
|
tests/conftest.py,sha256=WOrMDmrxdYskt1nQmbPPhZ6zo1cJzS4vO7gVcKuEo2k,2545
|
|
3
|
-
tests/test_cli.py,sha256=
|
|
4
|
-
tests/test_cuda.py,sha256=
|
|
5
|
-
tests/test_engine.py,sha256=
|
|
3
|
+
tests/test_cli.py,sha256=VPvaVO8POqA9RiG3doO_WpK3VwloSp7qvhCXbeiC10k,4865
|
|
4
|
+
tests/test_cuda.py,sha256=m2OS06a9aiYs60vK58gpOPiIpCnggNhhgeiJwbAKFQY,4798
|
|
5
|
+
tests/test_engine.py,sha256=fFzcbqZuMkzZHjA5FMddWcqVE703iq8HB_a0Q2lcBKM,4705
|
|
6
6
|
tests/test_explorer.py,sha256=r1pWer2y290Y0DqsM-La7egfEY0497YCdC4rwq3URV4,2178
|
|
7
|
-
tests/test_exports.py,sha256=
|
|
8
|
-
tests/test_integrations.py,sha256=
|
|
9
|
-
tests/test_python.py,sha256=
|
|
10
|
-
ultralytics/__init__.py,sha256=
|
|
7
|
+
tests/test_exports.py,sha256=V3WWS2JS1Fkzr3wCcLWFZMZ60ANAIKr1lFdNMfnSZSs,6863
|
|
8
|
+
tests/test_integrations.py,sha256=8Ru7GyKV8j44EEc8X9_E7q7aR4CTOIMPuSagXjSGUxw,5847
|
|
9
|
+
tests/test_python.py,sha256=TIeXeLJcf8X9K_NRwlGmk30cEwKGQmcro6X8mKqQ-IY,20003
|
|
10
|
+
ultralytics/__init__.py,sha256=T3NbDt2Mt82UFibP-PY-4UEXQhcjEc6RJm4i9AdgQdE,633
|
|
11
11
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
|
12
12
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
|
13
13
|
ultralytics/cfg/__init__.py,sha256=lR6jykSO_0cigsjrqSyFj_8JG_LvYi796viasyWhcfs,21358
|
|
@@ -74,14 +74,14 @@ ultralytics/cfg/trackers/botsort.yaml,sha256=YrPmj18p1UU40kJH5NRdL_4S8f7knggkk_q
|
|
|
74
74
|
ultralytics/cfg/trackers/bytetrack.yaml,sha256=QvHmtuwulK4X6j3T5VEqtCm0sbWWBUVmWPcCcM20qe0,688
|
|
75
75
|
ultralytics/data/__init__.py,sha256=VGe-ATG7j35F4A4r8Jmzffjlhve4JAJPgRa5ahKTU18,616
|
|
76
76
|
ultralytics/data/annotator.py,sha256=evXQzARVerc0hb9ol-n_GrrHf-dlXO4lCMMWEZoJ2UM,2117
|
|
77
|
-
ultralytics/data/augment.py,sha256=
|
|
77
|
+
ultralytics/data/augment.py,sha256=XOcVRcc1qx3b98YdvrpwNPgNBeJAx2fpC06Y7XLAdkw,59600
|
|
78
78
|
ultralytics/data/base.py,sha256=C3teLnw97ZTbpJHT9P7yYWosAKocMzgJjRe1rxgfpls,13524
|
|
79
79
|
ultralytics/data/build.py,sha256=nFdshVSDqU-tY9luH1T-cYnWHEdh9PtxRkwrs2UahMo,7268
|
|
80
80
|
ultralytics/data/converter.py,sha256=NLDiV67RshbKQnMJUiQQF11boVzEqgi2Hz39nKVAI4U,17528
|
|
81
81
|
ultralytics/data/dataset.py,sha256=NFaXyHRn64TyTEbtSkr7SkqWXK8bEJl6lZ6M1JwO3MY,22201
|
|
82
|
-
ultralytics/data/loaders.py,sha256=
|
|
82
|
+
ultralytics/data/loaders.py,sha256=b6XZVOHO_f5mCz3MFYTmXmL0Op6FQ-D5qJTReEgfCN0,23931
|
|
83
83
|
ultralytics/data/split_dota.py,sha256=PQdkwwlFtLKhWIrbToshSekXGdgbrbYMN6hM4ujfa7o,10010
|
|
84
|
-
ultralytics/data/utils.py,sha256=
|
|
84
|
+
ultralytics/data/utils.py,sha256=zqFg4xaWU--fastZmwvZ3DxGyJQ3i4tVNLuYnqS1xxs,31044
|
|
85
85
|
ultralytics/data/explorer/__init__.py,sha256=-Y3m1ZedepOQUv_KW82zaGxvU_PSHcuwUTFqG9BhAr4,113
|
|
86
86
|
ultralytics/data/explorer/explorer.py,sha256=0psbV96Qjbo2l_jGyM8WWnHq2gJREp_qq9YWPoxVxXE,18711
|
|
87
87
|
ultralytics/data/explorer/utils.py,sha256=EvvukQiQUTBrsZznmMnyEX2EqTuwZo_Geyc8yfi8NIA,7085
|
|
@@ -163,13 +163,13 @@ ultralytics/nn/modules/conv.py,sha256=Ywe87IhuaS22mR2JJ9xjnW8Sb-m7WTjxuqIxV_Dv8l
|
|
|
163
163
|
ultralytics/nn/modules/head.py,sha256=3N_4zW1UvhI1jCrIxIkNYxQDdiW6HxtxpaNAAudq6NU,22236
|
|
164
164
|
ultralytics/nn/modules/transformer.py,sha256=AxD9uURpCl-EqvXe3DiG6JW-pBzB16G-AahLdZ7yayo,17909
|
|
165
165
|
ultralytics/nn/modules/utils.py,sha256=779QnnKp9v8jv251ESduTXJ0ol8HkIOLbGQWwEGQjhU,3196
|
|
166
|
-
ultralytics/solutions/__init__.py,sha256=
|
|
166
|
+
ultralytics/solutions/__init__.py,sha256=S4m7p_rpg2pk9PdnqqD-6Sk--wDHxZSo7cUZjSwj_iQ,561
|
|
167
167
|
ultralytics/solutions/ai_gym.py,sha256=HDzzvBVFqWgQw2IgtEx5Eo3tEKbFRY3gkiVqax-4j2w,4683
|
|
168
|
-
ultralytics/solutions/analytics.py,sha256=
|
|
168
|
+
ultralytics/solutions/analytics.py,sha256=l5FeVQAJYIKRAAWqT_lWPBbCHCuYGYdMn55UYVLmEf4,7094
|
|
169
169
|
ultralytics/solutions/distance_calculation.py,sha256=pSIkyytHGRAaNzIrkkNkiOnSVWU1PYvURlCIV_jRORA,6505
|
|
170
170
|
ultralytics/solutions/heatmap.py,sha256=AHXnmXhoQ95ph74zsdrvX_Lfy3wF0SsH0MIeTixE7Qg,10386
|
|
171
171
|
ultralytics/solutions/object_counter.py,sha256=htcQGWJX1y-vXVV1yUiTDT3sm8ByItjSNfu2Rl2IEmk,10808
|
|
172
|
-
ultralytics/solutions/parking_management.py,sha256=
|
|
172
|
+
ultralytics/solutions/parking_management.py,sha256=Bd7FU3WZ8mRBWq81Z5c8jH5WloF4jPKo8TycqU_AcEI,9786
|
|
173
173
|
ultralytics/solutions/queue_management.py,sha256=ECm6gLZplmE9Cm-zdOazHBBDcW-vvr8nx2M28fcPbts,6787
|
|
174
174
|
ultralytics/solutions/speed_estimation.py,sha256=kjqMSHGTHMZaNgTKNKWULxnJQNsvhq4WMUphMVlBjsc,6768
|
|
175
175
|
ultralytics/trackers/__init__.py,sha256=j72IgH2dZHQArMPK4YwcV5ieIw94fYvlGdQjB9cOQKw,227
|
|
@@ -210,9 +210,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=5Z3ua5YBTUS56FH8VQKQG1aaIo9fH8GEyz
|
|
|
210
210
|
ultralytics/utils/callbacks/raytune.py,sha256=ODVYzy-CoM4Uge0zjkh3Hnh9nF2M0vhDrSenXnvcizw,705
|
|
211
211
|
ultralytics/utils/callbacks/tensorboard.py,sha256=Z1veCVcn9THPhdplWuIzwlsW2yF7y-On9IZIk3khM0Y,4135
|
|
212
212
|
ultralytics/utils/callbacks/wb.py,sha256=DViD0KeXH_i3eVT_CLR4bZFs1TMMUZBVBBYIS3aUfp0,6745
|
|
213
|
-
ultralytics-8.2.
|
|
214
|
-
ultralytics-8.2.
|
|
215
|
-
ultralytics-8.2.
|
|
216
|
-
ultralytics-8.2.
|
|
217
|
-
ultralytics-8.2.
|
|
218
|
-
ultralytics-8.2.
|
|
213
|
+
ultralytics-8.2.23.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
214
|
+
ultralytics-8.2.23.dist-info/METADATA,sha256=KEieAAb0IT-cnMnzHrA9586BSoU4LIznvicbxlmlMfk,41165
|
|
215
|
+
ultralytics-8.2.23.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
216
|
+
ultralytics-8.2.23.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
|
217
|
+
ultralytics-8.2.23.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
|
218
|
+
ultralytics-8.2.23.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|