Skip to content

Instantly share code, notes, and snippets.

View Ammar-Ishfaq's full-sized avatar
Focusing

Muhammad Ammar Ammar-Ishfaq

Focusing
View GitHub Profile
@Ammar-Ishfaq
Ammar-Ishfaq / train_val_test_split.py
Last active August 24, 2024 10:55
train_val_test_split.py
### Python script to split a labeled image dataset into Train, Validation, and Test folders.
# Author: Evan Juras, EJ Technology Consultants
# Date: 4/10/21
# Randomly splits images to 80% train, 10% validation, and 10% test, and moves them to their respective folders.
# This script is intended to be used in the TFLite Object Detection Colab notebook here:
# https://colab.research.google.com/github/EdjeElectronics/TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi/blob/master/Train_TFLite2_Object_Detction_Model.ipynb
from pathlib import Path
import random
fun main() {
val sportStats = listOf(
Summary(Sport.HIKE, 92),
Summary(Sport.RUN, 77),
Summary(Sport.TOURING_BICYCLE, 322),
Summary(Sport.E_TOURING_BICYCLE, 656)
)
val nonEBikeStats = sportStats.filter { it.sport != Sport.E_TOURING_BICYCLE }