Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df7a464e03 | |||
| e2e0653de6 |
2
.env
2
.env
@@ -1,5 +1,5 @@
|
|||||||
# Project
|
# Project
|
||||||
IMAGE_TAG=v1.8.12
|
IMAGE_TAG=v1.8.16
|
||||||
PROJECT_NAME=at-mintel
|
PROJECT_NAME=at-mintel
|
||||||
PROJECT_COLOR=#82ed20
|
PROJECT_COLOR=#82ed20
|
||||||
GITEA_TOKEN=ccce002e30fe16a31a6c9d5a414740af2f72a582
|
GITEA_TOKEN=ccce002e30fe16a31a6c9d5a414740af2f72a582
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
import * as fs from "node:fs";
|
|
||||||
import * as path from "node:path";
|
|
||||||
import * as https from "node:https";
|
|
||||||
|
|
||||||
import { fileURLToPath } from "node:url";
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
|
||||||
const __dirname = path.dirname(__filename);
|
|
||||||
const MODELS_DIR = path.join(__dirname, "..", "models");
|
|
||||||
const BASE_URL =
|
|
||||||
"https://raw.githubusercontent.com/vladmandic/face-api/master/model/";
|
|
||||||
|
|
||||||
const models = [
|
|
||||||
"tiny_face_detector_model-weights_manifest.json",
|
|
||||||
"tiny_face_detector_model-shard1",
|
|
||||||
];
|
|
||||||
|
|
||||||
async function downloadModel(filename: string) {
|
|
||||||
const destPath = path.join(MODELS_DIR, filename);
|
|
||||||
if (fs.existsSync(destPath)) {
|
|
||||||
console.log(`Model ${filename} already exists.`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
console.log(`Downloading ${filename}...`);
|
|
||||||
const file = fs.createWriteStream(destPath);
|
|
||||||
https
|
|
||||||
.get(BASE_URL + filename, (response) => {
|
|
||||||
response.pipe(file);
|
|
||||||
file.on("finish", () => {
|
|
||||||
file.close();
|
|
||||||
resolve(true);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.on("error", (err) => {
|
|
||||||
fs.unlinkSync(destPath);
|
|
||||||
reject(err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function main() {
|
|
||||||
if (!fs.existsSync(MODELS_DIR)) {
|
|
||||||
fs.mkdirSync(MODELS_DIR, { recursive: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const model of models) {
|
|
||||||
await downloadModel(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("All models downloaded successfully!");
|
|
||||||
}
|
|
||||||
|
|
||||||
main().catch(console.error);
|
|
||||||
@@ -43,7 +43,7 @@ async function detectFacesWithCloud(
|
|||||||
"X-Title": "Mintel Image Service",
|
"X-Title": "Mintel Image Service",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
model: "google/gemini-2.0-flash-001", // Fast, cheap, and supports vision
|
model: "google/gemini-3-flash-preview", // Fast, cheap, and supports vision
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: "user",
|
role: "user",
|
||||||
|
|||||||
656
pnpm-lock.yaml
generated
656
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user