-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaugmentation.php
32 lines (24 loc) · 909 Bytes
/
augmentation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
function GetFileTarget($dir, $save) {
echo "[INFO] Resource file: " . $dir."\n";
echo "[INFO] Saved directory: " . $save."\n";
foreach (glob($dir . "/*") as $target) {
if (is_writable($target)) {
GenerateImage($target, $save);
}
}
}
function GenerateImage($target, $save) {
$pecah = explode("/", $target);
$folder = $pecah[1];
echo "[INFO] Generating dataset from ".$folder.".\n";
foreach(glob($target.'/*.*') as $file) {
echo "[INFO] Augmentating " . $file."\n";
if(!is_dir($save . "/" . $folder)) {
mkdir($save . "/" . $folder);
}
echo shell_exec("py -3.6 augmentation.py --image ".$file." --output " . $save . "/" . $folder . "/");
echo "----------------------------------------------------------------\n";
}
}
echo GetFileTarget("datasets-real", "datasets-generate");