📋
docs.binaexperts.com
  • Introduction
  • Get Started
  • Organization
    • Create an Organization
    • Add Team Members
    • Role-Based Access Control
  • Datasets
    • Creating a Project
    • Uploading Data
      • Uploading Video
    • Manage Batches
    • Create a Dataset Version
    • Preprocessing Images
    • Creating Augmented Images
    • Add Tags to Images
    • Manage Categories
    • Export Versions
    • Health Check
    • Merge Projects and Datasets
    • Delete an Image
    • Delete a Project
  • annotate
    • Annotation Tools
    • Use BinaExperts Annotate
  • Train
    • Train
    • Framework
      • Tensorflow
      • PyTorch
      • NVIDIA TAO
      • TFLite
    • Models
      • YOLO
      • CenterNet
      • EfficientNet
      • Faster R-CNN
      • Single Shot Multibox Detector (SSD)
      • DETR
      • DETECTRON2 FASTER RCNN
      • RETINANET
    • dataset healthcheck
      • Distribution of annotations based on their size relative
      • Distribution of annotations based on their size relative
    • TensorBoard
    • Hyperparameters
    • Advanced Hyperparameter
      • YAML
      • Image Size
      • Validation input image size
      • Patience
      • Rectangular training
      • Autoanchor
      • Weighted image
      • multi scale
      • learning rate
      • Momentum
  • Deployment
    • Deployment
      • Legacy
      • Deployment model (Triton)
    • Introducing the BinaExperts SDK
  • ابزارهای نشانه گذاری
  • استفاده از نشانه گذاری بینااکسپرتز
  • 🎓آموزش مدل
  • آموزش
  • چارچوب ها
    • تنسورفلو
    • پایتورچ
    • انویدیا تاو
    • تنسورفلو لایت
  • مدل
    • یولو
    • سنترنت
    • افیشنت نت
    • R-CNN سریعتر
    • SSD
    • DETR
    • DETECTRON2 FASTER RCNN
  • تست سلامت دیتاست
    • توزیع اندازه نسبی
    • رسم نمودار توزیع
  • تنسوربرد
  • ابرمقادیر
  • ابرمقادیر پیشرفته
    • YAML (یامل)
    • اندازه تصویر
    • اعتبار سنجی تصاویر ورودی
    • انتظار
    • آموزش مستطیلی
  • مستندات فارسی
    • معرفی بینااکسپرتز
    • آغاز به کار پلتفرم بینااکسپرتز
  • سازماندهی
    • ایجاد سازمان
    • اضافه کردن عضو
    • کنترل دسترسی مبتنی بر نقش
  • مجموعه داده ها
    • ایجاد یک پروژه
    • بارگذاری داده‌ها
      • بارگذاری ویدیو
    • مدیریت دسته ها
    • ایجاد یک نسخه از مجموعه داده
    • پیش‌پردازش تصاویر
    • ایجاد تصاویر افزایش یافته
    • افزودن تگ به تصاویر
    • مدیریت کلاس‌ها
  • برچسب گذاری
    • Page 3
  • آموزش
    • Page 4
  • استقرار
    • Page 5
Powered by GitBook
On this page

Was this helpful?

  1. Train
  2. Advanced Hyperparameter

multi scale

Using varying image sizes, also known as multi-scale training, is a technique often employed in object detection tasks to improve the robustness and generalization of the trained model. Multi-scale training involves training the model on images of different sizes, allowing it to learn to detect objects at various scales.

Here's how you can implement multi-scale training with varying image sizes:

  1. Define Image Size Range: Determine the range of image sizes you want to use for training. This range typically involves scaling the original image size up and down by a certain percentage.

  2. Randomly Select Image Size: For each training iteration or mini-batch, randomly select an image size from the defined range. This randomness helps introduce variability and prevents the model from overfitting to a specific scale.

  3. Resize Images: Resize the training images to the selected size before feeding them into the model for training. This ensures that the model receives training samples of different scales in each iteration.

  4. Training: Train the model using the resized images. The model should learn to detect objects at various scales, leading to improved generalization and robustness.

Here's an example of how you might implement multi-scale training in Python using the PyTorch framework:

import random
import torch
from torchvision import transforms

# Define the range of image sizes (e.g., +/- 50% of the original size)
min_scale = 0.5
max_scale = 1.5

# Custom dataset and DataLoader setup
# Assuming dataset is your custom dataset

# Define a function to randomly select an image size from the defined range
def random_resize(image, min_scale, max_scale):
    target_scale = random.uniform(min_scale, max_scale)
    new_width = int(image.width * target_scale)
    new_height = int(image.height * target_scale)
    return transforms.Resize((new_height, new_width))(image)

# Define a transformation to resize images to the randomly selected size
transform = transforms.Compose([
    transforms.ToPILImage(),
    transforms.Lambda(lambda img: random_resize(img, min_scale, max_scale)),
    transforms.ToTensor(),
    # Add other transformations as needed (e.g., normalization)
])

# Apply the transformation to the dataset
# Assuming dataset is a PyTorch Dataset object
dataset = dataset.transform(transform)

# DataLoader setup
# Assuming batch_size, num_workers, etc., are defined elsewhere
dataloader = torch.utils.data.DataLoader(dataset, batch_size=batch_size, num_workers=num_workers, shuffle=True)

In this example, each image in the dataset is randomly resized to a scale within the defined range (50% smaller to 50% larger than the original size) before being fed into the model for training. This process helps the model learn to detect objects at various scales, leading to improved performance and robustness.

PreviousWeighted imageNextlearning rate

Last updated 1 year ago

Was this helpful?