#!/usr/bin/env php <?php include "NudeDetector.php"; $method = 'HSV'; if ($argc == 1) { exit; } $input_file = $argv[1]; $detector = new NudeDetector($input_file, $method); $detector->calculate_everything(); $img = $detector->skin_map; imagegif($img, $argv[2]);
#!/usr/bin/env php <?php include "NudeDetector.php"; if ($argc == 1) { exit; } $hsv = new NudeDetector(null, 'HSV'); $hsv->reasons = TRUE; $ycbcr = new NudeDetector(null, 'YCbCr'); $ycbcr->reasons = TRUE; foreach ($argv as $idx => $arg) { if ($idx == 0) { continue; } $hsv->set_file_name($arg); $y = $hsv->is_nude(); echo $arg . "\tHSV\t"; if ($y) { echo "NUDITY!\n"; } else { echo "Not nude.\n"; } $ycbcr->set_file_name($arg); $y = $ycbcr->is_nude(); echo $arg . "\tYCbCr\t"; if ($y) { echo "NUDITY!\n"; } else { echo "Not nude.\n"; } }
#!/usr/bin/env php <?php include "NudeDetector.php"; if ($argc == 1) { exit; } $input_file = $argv[1]; $prefix = $argv[2]; $hsv = new NudeDetector($input_file, 'HSV'); $ycbcr = new NudeDetector($input_file, 'YCbCr'); $hsv->map_skin_pixels(); $ycbcr->map_skin_pixels(); $img = $hsv->skin_map; imagegif($img, $prefix . 'HSV.gif'); $img = $ycbcr->skin_map; imagegif($img, $prefix . 'YCbCr.gif');
#!/usr/bin/env php <?php include "NudeDetector.php"; if ($argc == 1) { exit; } $input_file = $argv[1]; $detector = new NudeDetector($input_file, 'HSV'); echo "map skin pixels\n"; $detector->map_skin_pixels(); echo "determine regions\n"; $detector->determine_regions(); echo "count region populations\n"; $detector->count_region_population(); $detector->sort_regions_by_population(); echo "create colored regions\n"; $img = $detector->create_colored_regions(); imagegif($img, $argv[2]); imagedestroy($img);