Created
January 23, 2022 00:30
-
-
Save gb96/26cfd87cb3372da91f50614b39bd1f14 to your computer and use it in GitHub Desktop.
YOLOv5 Training -- Remove all validation images larger than 80000 bytes and also corresponding labels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Windows PowerShell script for removing validation images that meet some condition. | |
# Whenever an image is removed we also remove the corresponding annotations file | |
Get-ChildItem -Path .\valid\images -Recurse | ForEach-Object{ | |
if ($_.Length -gt 80000){ | |
Remove-Item ".\valid\images\$_" -Force | |
Remove-Item ".\valid\labels\$_".Replace(".jpg", ".txt") -Force | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment