-
Upload a Movie (.mp4)
-
-
- {progress > 0 && (
-
Upload Progress: {progress}%
+
+
+
+
+
+
+
+
+ {file && (
+
+
+ Selected file: {file.name}
+
+
+ )}
+
+
+
+
+ {error && (
+
+ )}
+
+ {uploadedUrl && (
+
)}
- {message &&
{message}
}
+ {/* Image Gallery */}
+
+
Uploaded Images
+
+ {images?.map((image, index) => (
+
+

+
+ ))}
+
+
);
diff --git a/package-lock.json b/package-lock.json
index 9724f39..299e825 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,11 +14,13 @@
"@types/multer": "^1.4.12",
"formidable": "^3.5.2",
"framer-motion": "^12.4.1",
+ "lucide-react": "^0.475.0",
"multer": "^1.4.5-lts.1",
"next": "15.1.6",
"next-auth": "^5.0.0-beta.25",
"react": "^19.0.0",
- "react-dom": "^19.0.0"
+ "react-dom": "^19.0.0",
+ "tls": "^0.0.1"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
@@ -4714,6 +4716,15 @@
"dev": true,
"license": "ISC"
},
+ "node_modules/lucide-react": {
+ "version": "0.475.0",
+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.475.0.tgz",
+ "integrity": "sha512-NJzvVu1HwFVeZ+Gwq2q00KygM1aBhy/ZrhY9FsAgJtpB+E4R7uxRk9M2iKvHa6/vNxZydIB59htha4c2vvwvVg==",
+ "license": "ISC",
+ "peerDependencies": {
+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ }
+ },
"node_modules/math-intrinsics": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -6655,6 +6666,11 @@
"node": ">=0.8"
}
},
+ "node_modules/tls": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/tls/-/tls-0.0.1.tgz",
+ "integrity": "sha512-GzHpG+hwupY8VMR6rYsnAhTHqT/97zT45PG8WD5eTT1lq+dFE0nN+1PYpsoBcHJgSmTz5ceK2Cv88IkPmIPOtQ=="
+ },
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
diff --git a/package.json b/package.json
index ca8a208..42543d8 100644
--- a/package.json
+++ b/package.json
@@ -15,11 +15,13 @@
"@types/multer": "^1.4.12",
"formidable": "^3.5.2",
"framer-motion": "^12.4.1",
+ "lucide-react": "^0.475.0",
"multer": "^1.4.5-lts.1",
"next": "15.1.6",
"next-auth": "^5.0.0-beta.25",
"react": "^19.0.0",
- "react-dom": "^19.0.0"
+ "react-dom": "^19.0.0",
+ "tls": "^0.0.1"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
diff --git a/prisma/migrations/20250208101922_render/migration.sql b/prisma/migrations/20250208101922_render/migration.sql
new file mode 100644
index 0000000..a0c12bd
--- /dev/null
+++ b/prisma/migrations/20250208101922_render/migration.sql
@@ -0,0 +1,2 @@
+-- DropIndex
+DROP INDEX "Image_name_key";
diff --git a/public/expand.svg b/public/expand.svg
new file mode 100644
index 0000000..382e635
--- /dev/null
+++ b/public/expand.svg
@@ -0,0 +1,9 @@
+
diff --git a/public/expanded.svg b/public/expanded.svg
new file mode 100644
index 0000000..a2f09f1
--- /dev/null
+++ b/public/expanded.svg
@@ -0,0 +1,9 @@
+
diff --git a/public/feat1.svg b/public/feat1.svg
new file mode 100644
index 0000000..638db82
--- /dev/null
+++ b/public/feat1.svg
@@ -0,0 +1,20 @@
+
diff --git a/public/feat2.svg b/public/feat2.svg
new file mode 100644
index 0000000..4ee22bc
--- /dev/null
+++ b/public/feat2.svg
@@ -0,0 +1,28 @@
+
diff --git a/public/feat3.svg b/public/feat3.svg
new file mode 100644
index 0000000..a6f7883
--- /dev/null
+++ b/public/feat3.svg
@@ -0,0 +1,31 @@
+
diff --git a/public/feat4.svg b/public/feat4.svg
new file mode 100644
index 0000000..bd1f548
--- /dev/null
+++ b/public/feat4.svg
@@ -0,0 +1,22 @@
+
diff --git a/public/feat5.svg b/public/feat5.svg
new file mode 100644
index 0000000..99f99b6
--- /dev/null
+++ b/public/feat5.svg
@@ -0,0 +1,20 @@
+
diff --git a/public/feat6.svg b/public/feat6.svg
new file mode 100644
index 0000000..907a058
--- /dev/null
+++ b/public/feat6.svg
@@ -0,0 +1,19 @@
+
diff --git a/public/feat7.svg b/public/feat7.svg
new file mode 100644
index 0000000..3303317
--- /dev/null
+++ b/public/feat7.svg
@@ -0,0 +1,23 @@
+
diff --git a/public/fonts/Deutschlander.otf b/public/fonts/Deutschlander.otf
new file mode 100644
index 0000000..2619127
Binary files /dev/null and b/public/fonts/Deutschlander.otf differ
diff --git a/utils/ml-actions/proccessImage.ts b/utils/ml-actions/proccessImage.ts
index ef33bcf..fdaca10 100644
--- a/utils/ml-actions/proccessImage.ts
+++ b/utils/ml-actions/proccessImage.ts
@@ -3,67 +3,66 @@ import { projectClient } from '@/lib/bucket-client';
export async function processImage(imageUrl: string, imageId: string, userId: string, imageName: string) {
try {
- // Send the image to ML server
+
const response = await fetch(`${process.env.ML_SERVER_URL}/analyze-waste`, {
method: "POST",
headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ imageUrl }),
+ body: JSON.stringify({ image_url: imageUrl }),
});
const data = await response.json();
+ console.log(data);
- // Convert base64 to buffer
- const base64Image = data.visualisation.replace(/^data:image\/\w+;base64,/, '');
+
+ const base64Image = data.visualization.replace(/^data:image\/\w+;base64,/, '');
const buffer = Buffer.from(base64Image, 'base64');
-
- // Upload processed image to bucket
+
const processedImageFileName = `${Date.now()}-${userId}-processed-${imageName}.png`;
const processedImageUrl = await projectClient.uploadFile(
buffer,
processedImageFileName
);
- // Save analysis results to database
- const analysis = await prisma.wasteAnalysis.create({
- data: {
- imageId,
- totalWeightKg: data.total_stats.total_weight_kg,
- wasteCoverage: data.total_stats.waste_coverage,
- distributionEvenness: data.total_stats.distribution_evenness,
- compositions: {
- create: [
- {
- type: 'RIGID_PLASTIC',
- present: data.waste_composition.rigid_plastic.present,
- pixelCount: data.waste_composition.rigid_plastic.pixel_count,
- areaPercentage: data.waste_composition.rigid_plastic.area_percentage,
- estimatedWeightKg: data.waste_composition.rigid_plastic.estimated_weight_kg,
- },
- {
- type: 'CARDBOARD',
- present: data.waste_composition.cardboard.present,
- pixelCount: data.waste_composition.cardboard.pixel_count,
- areaPercentage: data.waste_composition.cardboard.area_percentage,
- estimatedWeightKg: data.waste_composition.cardboard.estimated_weight_kg,
- },
- {
- type: 'METAL',
- present: data.waste_composition.metal.present,
- pixelCount: data.waste_composition.metal.pixel_count,
- areaPercentage: data.waste_composition.metal.area_percentage,
- estimatedWeightKg: data.waste_composition.metal.estimated_weight_kg,
- },
- {
- type: 'SOFT_PLASTIC',
- present: data.waste_composition.soft_plastic.present,
- pixelCount: data.waste_composition.soft_plastic.pixel_count,
- areaPercentage: data.waste_composition.soft_plastic.area_percentage,
- estimatedWeightKg: data.waste_composition.soft_plastic.estimated_weight_kg,
- },
- ],
- },
- },
- });
+ // const analysis = await prisma.wasteAnalysis.create({
+ // data: {
+ // imageId,
+ // totalWeightKg: data.total_stats.total_weight_kg,
+ // wasteCoverage: data.total_stats.waste_coverage,
+ // distributionEvenness: data.total_stats.distribution_evenness,
+ // compositions: {
+ // create: [
+ // {
+ // type: 'RIGID_PLASTIC',
+ // present: data.waste_composition.rigid_plastic.present,
+ // pixelCount: data.waste_composition.rigid_plastic.pixel_count,
+ // areaPercentage: data.waste_composition.rigid_plastic.area_percentage,
+ // estimatedWeightKg: data.waste_composition.rigid_plastic.estimated_weight_kg,
+ // },
+ // {
+ // type: 'CARDBOARD',
+ // present: data.waste_composition.cardboard.present,
+ // pixelCount: data.waste_composition.cardboard.pixel_count,
+ // areaPercentage: data.waste_composition.cardboard.area_percentage,
+ // estimatedWeightKg: data.waste_composition.cardboard.estimated_weight_kg,
+ // },
+ // {
+ // type: 'METAL',
+ // present: data.waste_composition.metal.present,
+ // pixelCount: data.waste_composition.metal.pixel_count,
+ // areaPercentage: data.waste_composition.metal.area_percentage,
+ // estimatedWeightKg: data.waste_composition.metal.estimated_weight_kg,
+ // },
+ // {
+ // type: 'SOFT_PLASTIC',
+ // present: data.waste_composition.soft_plastic.present,
+ // pixelCount: data.waste_composition.soft_plastic.pixel_count,
+ // areaPercentage: data.waste_composition.soft_plastic.area_percentage,
+ // estimatedWeightKg: data.waste_composition.soft_plastic.estimated_weight_kg,
+ // },
+ // ],
+ // },
+ // },
+ // });
await prisma.image.update({
where: { id: imageId },
@@ -72,7 +71,6 @@ export async function processImage(imageUrl: string, imageId: string, userId: st
return {
processedImageUrl,
- analysis
};
} catch (error) {
console.error("Error analyzing waste:", error);