-
Notifications
You must be signed in to change notification settings - Fork 0
/
5light.php
32 lines (26 loc) · 860 Bytes
/
5light.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
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$url = array_key_exists('url',$_REQUEST)?$_REQUEST['url']:0;
// Check if the "url" REQUEST variable is set
if ($url != 0) {
// Get the submitted URL
$submittedUrl = $_REQUEST["url"];
#echo $submittedUrl;
// Include the class file
require_once "classes/URLProcessor.php";
// Create an instance of the URLProcessor class
$urlProcessor = new URLProcessor();
//set desired python script (for the correct model)
$pythonScript = '/var/www/html/AI-carabids/5light_det.py';
// Process the submitted URL
$detoutput = $urlProcessor->processURL($submittedUrl, $pythonScript);
// Output the processed URL
header('Content-type: application/json');
include(str_replace("'","",$detoutput));
}
else{
echo 'Usage: 5light.php?url=path/to/image.jpg';
}
?>