Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#20157 Fix `hub/pro.md` docs page indentation issues

Merged
Ghost merged 3 commits into Ultralytics:main from ultralytics:fix-indentation
@@ -24,31 +24,31 @@ The Pro Plan provides early access to upcoming features and includes several enh
 
 
 You can upgrade to the Pro Plan from the [Billing & License](https://hub.ultralytics.com/settings?tab=billing) tab on the [Settings](https://hub.ultralytics.com/settings) page by following these steps:
 You can upgrade to the Pro Plan from the [Billing & License](https://hub.ultralytics.com/settings?tab=billing) tab on the [Settings](https://hub.ultralytics.com/settings) page by following these steps:
 
 
-1. Click on the **Upgrade** button
+1.  Click on the **Upgrade** button
 
 
-![Ultralytics HUB screenshot of the Settings page Billing & License tab with an arrow pointing to the Upgrade button](https://github.com/ultralytics/docs/releases/download/0/ultralytics-hub-settings-upgrade-button.avif)
+    ![Ultralytics HUB screenshot of the Settings page Billing & License tab with an arrow pointing to the Upgrade button](https://github.com/ultralytics/docs/releases/download/0/ultralytics-hub-settings-upgrade-button.avif)
 
 
-2. Select the Pro Plan
+2.  Select the Pro Plan
 
 
-![Ultralytics HUB screenshot of the Upgrade dialog with an arrow pointing to the Select Plan button](https://github.com/ultralytics/docs/releases/download/0/hub-pro-upgrade-select-plan.avif)
+    ![Ultralytics HUB screenshot of the Upgrade dialog with an arrow pointing to the Select Plan button](https://github.com/ultralytics/docs/releases/download/0/hub-pro-upgrade-select-plan.avif)
 
 
-!!! tip
+    !!! tip
 
 
-    You can save 20% if you choose the annual Pro Plan.
+        You can save 20% if you choose the annual Pro Plan.
 
 
-    ![Ultralytics HUB screenshot of the Upgrade dialog with an arrow pointing to the Save 20% toggle and one to the Select Plan button](https://github.com/ultralytics/docs/releases/download/0/hub-pro-upgrade-save-20-toggle.avif)
+        ![Ultralytics HUB screenshot of the Upgrade dialog with an arrow pointing to the Save 20% toggle and one to the Select Plan button](https://github.com/ultralytics/docs/releases/download/0/hub-pro-upgrade-save-20-toggle.avif)
 
 
-3. Fill in your details during the checkout
+3.  Fill in your details during the checkout
 
 
-![Ultralytics HUB screenshot of the Checkout with an arrow pointing to the checkbox for saving the payment information for future purchases](https://github.com/ultralytics/docs/releases/download/0/hub-pro-upgrade-save-payment-info.avif)
+    ![Ultralytics HUB screenshot of the Checkout with an arrow pointing to the checkbox for saving the payment information for future purchases](https://github.com/ultralytics/docs/releases/download/0/hub-pro-upgrade-save-payment-info.avif)
 
 
-!!! tip
+    !!! tip
 
 
-    We recommend ticking the checkbox to save your payment information for future purchases, facilitating easier top-ups to your account balance.
+         We recommend ticking the checkbox to save your payment information for future purchases, facilitating easier top-ups to your account balance.
 
 
-4. Complete the payment process
+4.  Complete the payment process
 
 
-![Ultralytics HUB screenshot of the Payment Successful dialog](https://github.com/ultralytics/docs/releases/download/0/payment-successful-dialog.avif)
+    ![Ultralytics HUB screenshot of the Payment Successful dialog](https://github.com/ultralytics/docs/releases/download/0/payment-successful-dialog.avif)
 
 
 ## Managing Your Account Balance
 ## Managing Your Account Balance
 
 
@@ -58,12 +58,12 @@ The account balance is used to pay for [Ultralytics Cloud Training](./cloud-trai
 
 
 1. Click on the **Top-Up** button in the Billing & License tab
 1. Click on the **Top-Up** button in the Billing & License tab
 
 
-![Ultralytics HUB screenshot of the Settings page Billing & License tab with an arrow pointing to the Top-Up button](https://github.com/ultralytics/docs/releases/download/0/hub-pro-account-balance-top-up-button.avif)
+    ![Ultralytics HUB screenshot of the Settings page Billing & License tab with an arrow pointing to the Top-Up button](https://github.com/ultralytics/docs/releases/download/0/hub-pro-account-balance-top-up-button.avif)
 
 
 2. Set the amount you want to add to your balance
 2. Set the amount you want to add to your balance
 
 
-![Ultralytics HUB screenshot of the Checkout with an arrow pointing to the Change amount button](https://github.com/ultralytics/docs/releases/download/0/hub-pro-account-balance-change-amount.avif)
+    ![Ultralytics HUB screenshot of the Checkout with an arrow pointing to the Change amount button](https://github.com/ultralytics/docs/releases/download/0/hub-pro-account-balance-change-amount.avif)
 
 
 3. Complete the payment process
 3. Complete the payment process
 
 
-![Ultralytics HUB screenshot of the Payment Successful dialog](https://github.com/ultralytics/docs/releases/download/0/payment-successful-dialog-1.avif)
+    ![Ultralytics HUB screenshot of the Payment Successful dialog](https://github.com/ultralytics/docs/releases/download/0/payment-successful-dialog-1.avif)
Discard
@@ -136,6 +136,9 @@ chr043416@gmail.com:
 davis.justin@mssm.org:
 davis.justin@mssm.org:
   avatar: https://avatars.githubusercontent.com/u/23462437?v=4
   avatar: https://avatars.githubusercontent.com/u/23462437?v=4
   username: justincdavis
   username: justincdavis
+fcakyon@gmail.com:
+  avatar: https://avatars.githubusercontent.com/u/34196005?v=4
+  username: fcakyon
 francesco.mttl@gmail.com:
 francesco.mttl@gmail.com:
   avatar: https://avatars.githubusercontent.com/u/3855193?v=4
   avatar: https://avatars.githubusercontent.com/u/3855193?v=4
   username: ambitious-octopus
   username: ambitious-octopus
Discard
Discard
@@ -442,7 +442,7 @@ def _handle_deprecation(custom: Dict) -> Dict:
         "hide_conf": ("show_conf", lambda v: not bool(v)),
         "hide_conf": ("show_conf", lambda v: not bool(v)),
         "line_thickness": ("line_width", lambda v: v),
         "line_thickness": ("line_width", lambda v: v),
     }
     }
-    removed_keys = {"label_smoothing", "save_hybrid"}
+    removed_keys = {"label_smoothing", "save_hybrid", "crop_fraction"}
 
 
     for old_key, (new_key, transform) in deprecated_mappings.items():
     for old_key, (new_key, transform) in deprecated_mappings.items():
         if old_key not in custom:
         if old_key not in custom:
Discard
@@ -118,7 +118,6 @@ copy_paste: 0.0 # (float) segment copy-paste (probability)
 copy_paste_mode: "flip" # (str) the method to do copy_paste augmentation (flip, mixup)
 copy_paste_mode: "flip" # (str) the method to do copy_paste augmentation (flip, mixup)
 auto_augment: randaugment # (str) auto augmentation policy for classification (randaugment, autoaugment, augmix)
 auto_augment: randaugment # (str) auto augmentation policy for classification (randaugment, autoaugment, augmix)
 erasing: 0.4 # (float) probability of random erasing during classification training (0-0.9), 0 means no erasing, must be less than 1.0.
 erasing: 0.4 # (float) probability of random erasing during classification training (0-0.9), 0 means no erasing, must be less than 1.0.
-crop_fraction: 1.0 # (float) image crop fraction for classification (0.1-1), 1.0 means no crop, must be greater than 0.
 
 
 # Custom config.yaml ---------------------------------------------------------------------------------------------------
 # Custom config.yaml ---------------------------------------------------------------------------------------------------
 cfg: # (str, optional) for overriding defaults.yaml
 cfg: # (str, optional) for overriding defaults.yaml
Discard
@@ -21,7 +21,6 @@ from ultralytics.utils.torch_utils import TORCHVISION_0_10, TORCHVISION_0_11, TO
 
 
 DEFAULT_MEAN = (0.0, 0.0, 0.0)
 DEFAULT_MEAN = (0.0, 0.0, 0.0)
 DEFAULT_STD = (1.0, 1.0, 1.0)
 DEFAULT_STD = (1.0, 1.0, 1.0)
-DEFAULT_CROP_FRACTION = 1.0
 
 
 
 
 class BaseTransform:
 class BaseTransform:
@@ -2446,7 +2445,7 @@ def classify_transforms(
     mean=DEFAULT_MEAN,
     mean=DEFAULT_MEAN,
     std=DEFAULT_STD,
     std=DEFAULT_STD,
     interpolation="BILINEAR",
     interpolation="BILINEAR",
-    crop_fraction: float = DEFAULT_CROP_FRACTION,
+    crop_fraction=None,
 ):
 ):
     """
     """
     Creates a composition of image transforms for classification tasks.
     Creates a composition of image transforms for classification tasks.
@@ -2461,7 +2460,7 @@ def classify_transforms(
         mean (tuple): Mean values for each RGB channel used in normalization.
         mean (tuple): Mean values for each RGB channel used in normalization.
         std (tuple): Standard deviation values for each RGB channel used in normalization.
         std (tuple): Standard deviation values for each RGB channel used in normalization.
         interpolation (str): Interpolation method of either 'NEAREST', 'BILINEAR' or 'BICUBIC'.
         interpolation (str): Interpolation method of either 'NEAREST', 'BILINEAR' or 'BICUBIC'.
-        crop_fraction (float): Fraction of the image to be cropped.
+        crop_fraction (float): Deprecated, will be removed in a future version.
 
 
     Returns:
     Returns:
         (torchvision.transforms.Compose): A composition of torchvision transforms.
         (torchvision.transforms.Compose): A composition of torchvision transforms.
@@ -2473,12 +2472,12 @@ def classify_transforms(
     """
     """
     import torchvision.transforms as T  # scope for faster 'import ultralytics'
     import torchvision.transforms as T  # scope for faster 'import ultralytics'
 
 
-    if isinstance(size, (tuple, list)):
-        assert len(size) == 2, f"'size' tuples must be length 2, not length {len(size)}"
-        scale_size = tuple(math.floor(x / crop_fraction) for x in size)
-    else:
-        scale_size = math.floor(size / crop_fraction)
-        scale_size = (scale_size, scale_size)
+    scale_size = size if isinstance(size, (tuple, list)) and len(size) == 2 else (size, size)
+
+    if crop_fraction:
+        raise DeprecationWarning(
+            "'crop_fraction' arg of classify_transforms is deprecated, will be removed in a future version."
+        )
 
 
     # Aspect ratio is preserved, crops center within image, no borders are added, image is lost
     # Aspect ratio is preserved, crops center within image, no borders are added, image is lost
     if scale_size[0] == scale_size[1]:
     if scale_size[0] == scale_size[1]:
@@ -2487,13 +2486,7 @@ def classify_transforms(
     else:
     else:
         # Resize the shortest edge to matching target dim for non-square target
         # Resize the shortest edge to matching target dim for non-square target
         tfl = [T.Resize(scale_size)]
         tfl = [T.Resize(scale_size)]
-    tfl.extend(
-        [
-            T.CenterCrop(size),
-            T.ToTensor(),
-            T.Normalize(mean=torch.tensor(mean), std=torch.tensor(std)),
-        ]
-    )
+    tfl += [T.CenterCrop(size), T.ToTensor(), T.Normalize(mean=torch.tensor(mean), std=torch.tensor(std))]
     return T.Compose(tfl)
     return T.Compose(tfl)
 
 
 
 
Discard
@@ -751,7 +751,7 @@ class ClassificationDataset:
                 hsv_v=args.hsv_v,
                 hsv_v=args.hsv_v,
             )
             )
             if augment
             if augment
-            else classify_transforms(size=args.imgsz, crop_fraction=args.crop_fraction)
+            else classify_transforms(size=args.imgsz)
         )
         )
 
 
     def __getitem__(self, i):
     def __getitem__(self, i):
Discard
@@ -249,7 +249,7 @@ class BasePredictor:
             getattr(
             getattr(
                 self.model.model,
                 self.model.model,
                 "transforms",
                 "transforms",
-                classify_transforms(self.imgsz[0], crop_fraction=self.args.crop_fraction),
+                classify_transforms(self.imgsz[0]),
             )
             )
             if self.args.task == "classify"
             if self.args.task == "classify"
             else None
             else None
Discard
@@ -219,9 +219,9 @@ def _format_prediction_annotations(image_path, metadata, class_label_map=None, c
         LOGGER.debug(f"COMET WARNING: Image: {image_path} has no bounding boxes predictions")
         LOGGER.debug(f"COMET WARNING: Image: {image_path} has no bounding boxes predictions")
         return None
         return None
 
 
-        # offset to align indices of class labels (starting from zero)
-        # with prediction's category ID indices (can start from one)
-    label_index_offset = sorted(class_map)[0] if class_map is not None else 0
+    # apply the mapping that was used to map the predicted classes when the JSON was created
+    if class_label_map and class_map:
+        class_label_map = {class_map[k]: v for k, v in class_label_map.items()}
     try:
     try:
         # import pycotools utilities to decompress annotations for various tasks, e.g. segmentation
         # import pycotools utilities to decompress annotations for various tasks, e.g. segmentation
         from pycocotools.mask import decode  # noqa
         from pycocotools.mask import decode  # noqa
@@ -234,7 +234,7 @@ def _format_prediction_annotations(image_path, metadata, class_label_map=None, c
         score = _scale_confidence_score(prediction["score"])
         score = _scale_confidence_score(prediction["score"])
         cls_label = prediction["category_id"]
         cls_label = prediction["category_id"]
         if class_label_map:
         if class_label_map:
-            cls_label = str(class_label_map[cls_label - label_index_offset])
+            cls_label = str(class_label_map[cls_label])
 
 
         annotation_data = {"boxes": [boxes], "label": cls_label, "score": score}
         annotation_data = {"boxes": [boxes], "label": cls_label, "score": score}
 
 
Discard