Skip to content
Snippets Groups Projects
Commit b9e1f50e authored by Hemanth VSR's avatar Hemanth VSR :speech_balloon:
Browse files

Initial commit

parents
Branches master
No related tags found
No related merge requests found
home = /usr/bin
include-system-site-packages = false
version = 3.12.3
executable = /usr/bin/python3.12
command = /usr/bin/python3 -m venv /root/htdocs/forest/my_env
<?php
require 'vendor/autoload.php'; // Load Twilio SDK
use Twilio\Rest\Client;
// Twilio credentials
$account_sid = "ACa3c3ee68b9231441158651b6fb6ca6b6";
$auth_token = "6e59bb108f3751c9785310c2aabf9a76";
$twilio_number = "+19085032061"; // Your Twilio phone number
$to_number = "+918667033365"; // Recipient's phone number
// Create Twilio client
$client = new Client($account_sid, $auth_token);
// Make the call
$call = $client->calls->create(
$to_number, // Destination phone number
$twilio_number, // Twilio phone number
[
"twiml" => "<Response><Say>Hello, this is a custom message from Twilio.</Say></Response>"
]
);
echo "Call initiated with SID: " . $call->sid;
?>
import os
import sys
image_path = sys.argv[1]
if not os.path.exists(f"/var/www/html/forest/my_env/preview/dan/{image_path}"):
import cv2
from pathlib import Path
from ultralytics import YOLO
model = YOLO("best.pt")
if os.path.exists(f"/var/www/html/forest/images/{image_path}"):
file_path = f"/var/www/html/forest/images/{image_path}"
else:
file_path = f"/var/www/html/forest/animals/{image_path}"
results = model(file_path, save=True, project="preview", name="dan", exist_ok=True)
saved_dir = Path("preview/dan")
for result in results:
for path in saved_dir.glob("*"):
if path.suffix.lower() not in [".jpeg"]:
img = cv2.imread(str(path))
new_path = path.with_suffix(".jpeg")
cv2.imwrite(str(new_path), img, [int(cv2.IMWRITE_JPEG_QUALITY), 95])
os.remove(str(path))
File added
File added
This diff is collapsed.
This diff is collapsed.
<?php
$dir = "/var/www/html/forest/animals/";
$files = array_values(array_diff(scandir($dir), array('.', '..')));
header('Content-Type: application/json');
echo json_encode($files);
?>
<?php
$IMAGE_DIR = "/var/www/html/forest/images/";
$files = array_values(array_filter(scandir($IMAGE_DIR), function($file) use ($IMAGE_DIR) {
return preg_match('/^\d+\.(jpg|jpeg|png|gif)$/i', $file);
}));
error_reporting(E_ALL);
ini_set('display_errors', 1);
usort($files, function($a, $b) {
return intval($b) - intval($a);
});
$page = isset($_GET['page']) ? intval($_GET['page']) : 0;
$limit = 12;
$start = $page * $limit;
$images = array_slice($files, $start, $limit);
header('Content-Type: application/json');
echo json_encode($images);
?>
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment