Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
baselhusam committed Mar 31, 2023
1 parent 3e912c2 commit 986147a
Showing 1 changed file with 48 additions and 42 deletions.
90 changes: 48 additions & 42 deletions YOLO_Training.ipynb
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"mount_file_id": "1MUexEIOhBloFzM0VO8XE1ovz4vgKiHI_",
"authorship_tag": "ABX9TyMaKkd7iRV75npYFFkq8dk9",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU",
"gpuClass": "standard"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "aJjdD9NV8Sji"
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"### Build a model for Face Detection with `Yolov8`"
"<a href=\"https://colab.research.google.com/github/baselhusam/Face-Blurring/blob/main/YOLO_Training.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"source": [
"### Build a model for Face Detection with `Yolov8`"
],
"metadata": {
"id": "aJjdD9NV8Sji"
}
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -23,24 +52,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "AbNKGTKgHO0U"
},
"outputs": [],
"source": [
"# Import Yolo\n",
"from ultralytics import YOLO\n",
"\n",
"# Build the model\n",
"model = YOLO('yolov8n.pt')"
]
],
"metadata": {
"id": "AbNKGTKgHO0U"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "IpVxGErQ8_zQ"
},
"source": [
"#### Train the Model\n",
"\n",
Expand All @@ -50,22 +76,28 @@
"* `epochs` : number of epochs, 100 in this case\n",
"* `optimizer` : the `Adam` optimizer in this case\n",
"* `batch` : 16 in this case"
]
],
"metadata": {
"id": "IpVxGErQ8_zQ"
}
},
{
"cell_type": "code",
"execution_count": null,
"source": [
"model.train(data = '/content/drive/MyDrive/progressSoft/yolov8n.yaml',epochs = 100, optimizer= 'Adam', batch=16)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "oHtC1jwiHwGT",
"outputId": "b3314ca2-d62d-42c1-988e-d885bbe611c9"
},
"execution_count": null,
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"name": "stderr",
"text": [
"Ultralytics YOLOv8.0.39 🚀 Python-3.8.10 torch-1.13.1+cu116 CUDA:0 (Tesla T4, 15110MiB)\n",
"\u001b[34m\u001b[1myolo/engine/trainer: \u001b[0mtask=detect, mode=train, model=yolov8n.pt, data=/content/drive/MyDrive/progressSoft/yolov8n.yaml, epochs=100, patience=50, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=8, project=None, name=None, exist_ok=False, pretrained=False, optimizer=Adam, verbose=True, seed=0, deterministic=True, single_cls=False, image_weights=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, min_memory=False, overlap_mask=True, mask_ratio=4, dropout=False, val=True, split=val, save_json=False, save_hybrid=False, conf=0.001, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=ultralytics/assets/, show=False, save_txt=False, save_conf=False, save_crop=False, hide_labels=False, hide_conf=False, vid_stride=1, line_thickness=3, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, boxes=True, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=None, workspace=4, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.001, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, fl_gamma=0.0, label_smoothing=0.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=0.0, mixup=0.0, copy_paste=0.0, cfg=None, v5loader=False, tracker=botsort, tracker_cfg=None, save_dir=runs/detect/train11\n",
Expand Down Expand Up @@ -621,33 +653,7 @@
"Results saved to \u001b[1mruns/detect/train11\u001b[0m\n"
]
}
],
"source": [
"model.train(data = '/content/drive/MyDrive/progressSoft/yolov8n.yaml',epochs = 100, optimizer= 'Adam', batch=16)"
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"provenance": []
},
"gpuClass": "standard",
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.9.13"
},
"vscode": {
"interpreter": {
"hash": "49cb93f377a7abe7414b7b0f21fb3017538004a126cf690fb524202736b7fb92"
}
}
},
"nbformat": 4,
"nbformat_minor": 0
}
]
}

0 comments on commit 986147a

Please sign in to comment.