Skip to content

Commit

Permalink
added details
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjalkar99 committed Nov 23, 2023
1 parent 474d2f9 commit ddec651
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 85 deletions.
86 changes: 43 additions & 43 deletions .firebase/hosting.ZGlzdA.cache
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
favicon.png,1693527463925,b1478580497a5822da29f6e15dcb675c88e05446c6b3d13001abb36cfffd80a9
index.html,1693527475437,a1d8a22d39f3787cb811e11a82b64641fc91f2dec52520ef539e600a7f0bc4ae
manifest.webmanifest,1693527475437,b4c3d3ed910cd5f728973ce2422e66b396a34ae1a7382cd6747406d39aa8f34d
registerSW.js,1693527475437,cffcd66cea54ba3f643931972304147da9b9e11da6411f809b0c540221cffb5e
sw.js,1693527478849,11857f3b132915862f66992f34b88c75d0f28d421a0ef4bc51169a77d813d9af
workbox-fa446783.js,1693527478853,b050508a87d24b9846f2ec33341530d16d32b7a9d56b01bc96ea2d14a88bf57d
assets/DetailsPage-5204d51d.js,1693527475433,19d06ae11b106a826aa2dce2c886e191899ce3ebf460d150f82f5d9d26da631b
assets/DetailsPage-e3b0c442.css,1693527475413,f61f27bd17de546264aa58f40f3aafaac7021e0ef69c17f6b1b4cd7664a037ec
assets/DetailsPage-legacy-9cac1916.js,1693527475009,ed5b2f36b7cad316c7a2b975edc413c899b189223cb1b4a4b653ea40ec6ef8fb
assets/HomePage-3cb79181.css,1693527475433,3158c7088cab7b1436ab648d26361912ec2ce83d95e5472bfa14d6f37240b420
assets/HomePage-497736ce.js,1693527475433,440f09c430956aa11d21f98546d5f854af6238c93fcf95220a8da0d91f337720
assets/HomePage-legacy-fd9e0608.js,1693527475009,c4b410b48958bc9b737c4f058c747ae6404b413dce82d50d75d956803f053252
assets/RadioPage-c040c89e.js,1693527475433,58a9a8acf5f52bec809bcd547084d51121f3536bd765fdb727fe000db7baeeb4
assets/RadioPage-c0c95f6e.css,1693527475433,ff218b5cd7937566117968c04e3d3f0f06bb4b0002d3e0935d0647cf3a186b9f
assets/RadioPage-legacy-e406851f.js,1693527475013,8647f3fae1fab20f57cdbe663ed0782b0209e8166200fa21d49b79e4cac10faf
assets/animation-67bb5f1c.js,1693527475417,19f3ec4eb6d98e63e52f9470daebae8f20b94b97dee822b925c72759cda4c86c
assets/animation-legacy-f2f8a127.js,1693527475005,fe376fd6057fb146ee6842d9b97d52a44ab49de9a236904caf56634b9cf59743
assets/focus-visible-9c13edeb.js,1693527475417,11c57e7f8a3a0138cc50ff7d77667afa69ce70d67ac3d9f341f9127892155e92
assets/focus-visible-legacy-b3e947fe.js,1693527475005,72b934c8e6f3da2be2e09fea9326bd5552e53cbe8a0aeaec576ba47d6484c17d
assets/hardware-back-button-77fd2980.js,1693527475417,ec61a41bec473c7b5524213ac6126fa2d9025190be2843dd14ca68600d0a58d4
assets/hardware-back-button-legacy-7391e573.js,1693527475005,18ad59c6ab1bb644d7e860ae68c41085b85c635f4e58b08eeae9cc8e9bc517fe
assets/index-4b578cc0.js,1693527475433,8f0a034accb7e4ad12b4bd5f977201fdc2c999adb0fba049b06750a4991036d8
assets/index-a9f1f86f.css,1693527475417,5726ec8054325ed5525606403042832323081fd1a7a844ce4ab682b3ca63608a
assets/index-legacy-e96a3347.js,1693527475013,c17dc1288094821d03caa6b5677431ac2b9d632128333d533c726c096b0e4e10
assets/index9-8e3ec3c8.js,1693527475425,915f1549fa9d26af813d09760fcb16c804089d80f97726672c5354f269d46cf0
assets/index9-legacy-46f8ba6b.js,1693527475005,4a4defc6e9bf6aa196ce3e780a6e4273f4ba7345f3cf100c292be13c32e05282
assets/input-shims-f6bec915.js,1693527475417,282ed7058deeb7b3d4ef9312779c730503c5ce930a6bf1f3940793ae44c1cbcb
assets/input-shims-legacy-0c416e48.js,1693527475005,5c736e97892c5556725d9a07845e606fbb8e2f59b6bac79585fd6b20f5cd86a3
assets/ios.transition-0beb0258.js,1693527475417,8edf4d662f4923b38a712eacd52128390012fca23823624b5a19e136da31d2ea
assets/ios.transition-legacy-83fa71a4.js,1693527475005,c50dc4a33f36b8ed3a0cdd0fed4ea0a8e69dc77d224b22f495d963d2dd2afa0e
assets/keyboard2-dac414ea.js,1693527475433,ef977d72d5cf80337ad8b23ee9116a8cfbc64f1053c7bcf1a2fd8d34c4f18c40
assets/keyboard2-legacy-5b972419.js,1693527475005,70af6a62eac8245835a4c909a0fd60539ded8038b64bd33751a3184cf07f2039
assets/md.transition-a63b2e4a.js,1693527475417,46898a311664bdc40c51f8a43d05e7b476dd22558412526c29c18f0052455200
assets/md.transition-legacy-5240b31d.js,1693527475005,de5817c9de8662c4054287e4300a005dc54d75bf0b62243151d9fcbb8c68117f
assets/polyfills-legacy-0030eee3.js,1693527475013,ff0903a979feadad31b6a8c8a4e38432db1b109f03dfe359438d85badfce34dc
assets/status-tap-af7202be.js,1693527475433,f0f2fb071b3bab3928c826ad187c004fb6bd7e15e8d9ed475c3f5f5523b89c59
assets/status-tap-legacy-46446192.js,1693527475005,c599a1f2d977574c8cef6ecd3fde698e871dd17feee5e3c6607646c9b8b2552f
assets/swipe-back-f2ef4979.js,1693527475433,928b31d4929c0687a7881da80c2e4e9244285ad1a5e71f5bc49bc4d588695abf
assets/swipe-back-legacy-55d4382c.js,1693527475001,d871abd35b8a410e9f239766ff0a5265571d82d557ca8a9746e627cb3423205b
assets/web-d6d31c87.js,1693527475417,3dec73357275c88d77d09f3da0defe761598de4a2bda11b6e37f074ab6e50715
assets/web-e22dc292.js,1693527475417,6aaee75340e530b58efa2cf32f92f07f5088bab387f10e4bf19eba7fc6eec9a0
assets/web-legacy-0cb39fbd.js,1693527475009,5b3e0c91363468271ad0ded953cb8bd8783b88db3adcdee1958668746f808552
assets/web-legacy-c55cc244.js,1693527475009,bd4802cf45d8b0f63a339da1bcbf38a4f4217b577575b6b4177be123d4890530
favicon.png,1700782373515,b1478580497a5822da29f6e15dcb675c88e05446c6b3d13001abb36cfffd80a9
index.html,1700782386083,e47b01915c5924946920fcfd7cb1b8df6cbddf943d3f23cad39a6a16436b6c06
manifest.webmanifest,1700782386083,b4c3d3ed910cd5f728973ce2422e66b396a34ae1a7382cd6747406d39aa8f34d
sw.js,1700782388171,743779c3fdc8a3871ad6e08c79e73872a99ec4f69f3f1ca25e26be9e4e21a4d6
workbox-fa446783.js,1700782388171,b050508a87d24b9846f2ec33341530d16d32b7a9d56b01bc96ea2d14a88bf57d
assets/DetailsPage-1afd2e4e.js,1700782386083,b61c887444e81ff47037033e5abbbbcd2cb7d62e5deeb478fa22bfd2133b0293
registerSW.js,1700782386083,cffcd66cea54ba3f643931972304147da9b9e11da6411f809b0c540221cffb5e
assets/DetailsPage-de62a9a0.css,1700782386079,f68bea2e3a9ca3d9f58dff8ed7bf72edcefbd6e060eced31d23ee076891aeffb
assets/DetailsPage-legacy-3efaa843.js,1700782385627,87fb89e1fc2610654af220437b4c4b36819571b02b7d830994049033270004d5
assets/PlantDetailsPage-4f6f36c9.js,1700782386083,237c2910d430d999e54aeeaf0df43613d46daabcb9a55c21f809094abd5b6cca
assets/HomePage-93cdaca6.css,1700782386079,cf838a7307ac1c014687c66f3be12b70b5825d6e2e546416c3a811f459aac1ec
assets/PlantDetailsPage-9f7c5337.css,1700782386079,61ac82c8f378c32b7c86cac0e24f2bffa0f40b14df55d8b007f8932c7df1e311
assets/RadioPage-6fc57ca9.js,1700782386083,204c2277fde925990ac38c3e523df2d4758a44610437e7e6a165c572b2e641b8
assets/RadioPage-legacy-e523e481.js,1700782385627,99ab9b29dd2bf51321c4d9f4c4af045a961406d4a0fa2c188a1b144aab8dbc14
assets/PlantDetailsPage-legacy-158fe656.js,1700782385627,799b965935735b3eca490d77ee683d13dcb58b36b02a7fb0bf5602aa329fd583
assets/focus-visible-9c13edeb.js,1700782386079,11c57e7f8a3a0138cc50ff7d77667afa69ce70d67ac3d9f341f9127892155e92
assets/HomePage-legacy-00dd170c.js,1700782385627,c23af774549a063e737b69394cdba93bdd1d4b5080bc20a8fc9e5f17993d718c
assets/focus-visible-legacy-b3e947fe.js,1700782385627,72b934c8e6f3da2be2e09fea9326bd5552e53cbe8a0aeaec576ba47d6484c17d
assets/RadioPage-5be363b1.css,1700782386079,fad6085e69524bcefb45a03a3080e6649553e7b92deb9b7e1f1bc6ae45f065df
assets/index-a9f1f86f.css,1700782386079,5726ec8054325ed5525606403042832323081fd1a7a844ce4ab682b3ca63608a
assets/input-shims-9dcdf36f.js,1700782386083,dcd8a216ce29a13475faae89f64af3b46c956078a3cabee7f6341460482aa6c6
assets/index9-6bed4f9a.js,1700782386083,7911c692a9f2ed4dd107fee74418bb13e4f5aa8b486ff8c61f5b6a61c99ef2b4
assets/input-shims-legacy-fb7c935d.js,1700782385627,ed9ab4b93decd471ab92329ef65e4d58966bfc03f405cec42b754e5273ef6942
assets/ios.transition-ca0199bd.js,1700782386083,962edb8f2424f0c72f1d50d38f7cb25174a56fdbaf1d4786be1bd7ea20a4b69c
assets/keyboard2-ae5cc831.js,1700782386083,65fccfd2c57eb77539966dcaa47c83fa5bae73c60b5e8b592e696eb179c54015
assets/md.transition-c29648ca.js,1700782386079,770654ce01c272e0d9d5584779e6915738ff6d09a8c7cf4bf249a94a84eed727
assets/ios.transition-legacy-05f20982.js,1700782385627,e5e87c74b16872f869013852219394a51f07fed2cba7ddb12119c016903e3172
assets/md.transition-legacy-8b4c0ad1.js,1700782385627,1d092c6fc1339a0e34383b7cd21e389e693be5f92feabba068471d3c999a23ad
assets/keyboard2-legacy-53795606.js,1700782385627,597095b38e1b5650628589d1532cd0ef5748cc955ec352f955cbc0d961033c00
assets/status-tap-6dadd92e.js,1700782386083,2bcaeeed925aeb1bddbaa031cb2f1c3a4c724a64bfdae7ea0078f1d12c464242
assets/swipe-back-legacy-d11c57a7.js,1700782385619,90e5f3e6392dd569742e0f65041993f7a35f9c9e5a224b5dbd7ec031579fbf24
assets/index9-legacy-c0b2afd5.js,1700782385627,fbf0ae8ec11e12f4ea83b5b79c8cb8c8a1ca8bf73a4af3a5ee77de116dbbfde1
assets/web-e2b14b38.js,1700782386079,28c4fa8046d703da3fd89d1f47f772634a6e33528db822f7f662b7266105eded
assets/web-legacy-813c19f1.js,1700782385627,a191cfebfa6c6ea85a8ffe2fe4926812cad6bcf7b65834cb84a2a30a131f21cf
assets/swipe-back-ee3aed09.js,1700782386079,cc16610658f5d3baa0c3b6a959bd0854b1b5ee4e0affed6dd3a0f08110066f4f
assets/HomePage-fdbed98b.js,1700782386083,6f2eb352e3252f242caddf55e1e70c3244ffa819289a56bc1586f7cb91ca869e
assets/web-legacy-cc1702ca.js,1700782385627,b0181ad4cc735f87fde7f9ad083ac5496640469e230155acf245a0fb65a1274a
assets/web-2ca4ed99.js,1700782386079,29cee4e7358db5024627672d351c447dc5c235365960f78cd1c34ef864d1774f
assets/status-tap-legacy-4d8240d0.js,1700782385627,f3f4e491e1807423820a8cd001245f6e65becc5191a0e47a9459eb349e80cc7c
assets/polyfills-legacy-c89c4da6.js,1700782385631,db38a6ecf381c944347ec3031b970c79247cfaeba5cfd5926fc06704c20a9b75
assets/index-3ef9eb74.js,1700782386083,e363763278dd370400a0b2def5b40b18da73ee48b39f2953cfc73261bf0efa02
assets/index-legacy-d3858320.js,1700782385631,e7aad9f6e67e50ab8030eea8489c3a3d2e8f3dadbcf5520a830dac6f5a051a5a
plant_village-1.0.2.png,1700782373515,6cb07aaa72a124ea5f7df2e28faa662eb2d2d2840ccfb98cb0a0f1afafee42d9
2 changes: 1 addition & 1 deletion dev-dist/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812"
}, {
"url": "index.html",
"revision": "0.kh3hanp6om"
"revision": "0.7p4md8jk7qg"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
Expand Down
64 changes: 34 additions & 30 deletions src/views/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
<ion-row v-for="photo in photos" :key="photo.filepath">
<ion-col size="12">
<ion-card>
<ion-img
:src="photo.webviewPath"
@click="showProgress(photo)"
></ion-img>
<ion-img :src="photo.webviewPath"></ion-img>
<ion-card-content>
<ion-button
v-if="!photo.prediction && !photo.processing"
Expand All @@ -30,30 +27,37 @@
<!-- Loading Spinner -->
<ion-spinner v-if="photo.processing" color="success"></ion-spinner>

<div v-if="photo.prediction">

<div v-if="photo.prediction !== undefined">
<ion-card-title>
<span class="predicted-class-key">Predicted Class:</span>
{{ photo.prediction.predicted_class }}
<ion-badge color="danger">
{{
Math.max(
...photo.prediction.class_probabilities[0].map(
(value) => value * 100
(value: number) => value * 100
)
).toFixed(2)
}}%
</ion-badge>
</ion-card-title>
<ion-button @click="goToDetailsPage">Show Details</ion-button>
<ion-button @click="goToDetailsPage">Show Details</ion-button>
</div>
<ion-select
v-if="!photo.prediction && !photo.processing"
placeholder="Select Option"
@ionChange="handleDropdownChange"
>
<ion-select-option value="option1">Model-1(PlantVillage Dataset){default}</ion-select-option>
<ion-select-option value="option2">Model-2(Own 27 classes Dataset)</ion-select-option>
<ion-select-option value="option2">Model-3(Own 20 classes Dataset {500 each})</ion-select-option>
<ion-select-option value="option1"
>Model-1(PlantVillage Dataset){default}</ion-select-option
>
<ion-select-option value="option2"
>Model-2(Own 27 classes Dataset)</ion-select-option
>
<ion-select-option value="option2"
>Model-3(Own 20 classes Dataset {500 each})</ion-select-option
>
<!-- Add more options as needed -->
</ion-select>
</ion-card-content>
Expand Down Expand Up @@ -119,12 +123,10 @@ import { camera } from "ionicons/icons";
import { useCamera } from "@/composables/useCamera";
import { useRouter } from "vue-router";
const BACKEND_URL = ref("https://pranjalkar9-patta-ai.hf.space/predict/");
const selectedOption = ref("option1"); // Add this line to store the selected option
const details = ref(null);
export default {
components: {
IonHeader,
Expand All @@ -145,13 +147,15 @@ export default {
IonSelect,
IonSelectOption,
},
methods: {
goToDetailsPage() {
// Navigate to the details page
this.$router.push({ name: "plant", params: { details: JSON.parse(details.value) } });
},
},
methods: {
goToDetailsPage() {
// Navigate to the details page
this.$router.push({
name: "plant",
params: { details: JSON.parse(details.value) },
});
},
},
setup() {
const { takePhoto, photos } = useCamera();
Expand All @@ -166,7 +170,8 @@ export default {
BACKEND_URL.value = "https://pranjalkar9-patta-ai.hf.space/predict/";
break;
case "option2":
BACKEND_URL.value = "https://pranjalkar9-patta-ai.hf.space/predict-self-dataset-27/";
BACKEND_URL.value =
"https://pranjalkar9-patta-ai.hf.space/predict-self-dataset-27/";
break;
case "option3":
BACKEND_URL.value = "https://pranjalkar9-patta-ai.hf.space/predict_20/";
Expand Down Expand Up @@ -198,16 +203,16 @@ export default {
});
console.log(axiosResponse.data);
if (axiosResponse.data.details) {
// Navigate to the details page
console.log("go to /plant");
// Use Vue Router to navigate
details.value = axiosResponse.data.details;
// router.push({ name: "plant", params: { details } });
}
console.log("This is now the details:",details.value)
if (axiosResponse.data.details) {
// Navigate to the details page
console.log("go to /plant");
// Use Vue Router to navigate
details.value = axiosResponse.data.details;
// router.push({ name: "plant", params: { details } });
}
console.log("This is now the details:", details.value);
photo.prediction = axiosResponse.data;
photo.processing = false;
} catch (error) {
Expand All @@ -227,4 +232,3 @@ console.log("This is now the details:",details.value)
},
};
</script>

26 changes: 15 additions & 11 deletions src/views/PlantDetailsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,26 @@ export default {
},
setup() {
const route = useRoute();
const details = ref(null);
const details = ref<Record<string, any> | null>(null);
const showDetails = ref(false);
// Access the details from the route parameters
onMounted(() => {
details.value = route.params.details;
showDetails.value = details.value !== null;
const receivedDetails = route.params.details;
console.log("Received route parameters:", route.params);
if (showDetails.value) {
console.log("Received details:", details.value);
} else {
console.log("No details received");
}
});
if (typeof receivedDetails === 'string') {
// Handle the case where details is a string
console.error('Received string instead of object:', receivedDetails);
} else if (Array.isArray(receivedDetails)) {
// Handle the case where details is an array of strings
console.error('Received array instead of object:', receivedDetails);
} else if (receivedDetails) {
// Handle the case where details is an object
details.value = receivedDetails;
showDetails.value = true;
console.log('This is received:', receivedDetails);
}
});
return {
details,
Expand Down

0 comments on commit ddec651

Please sign in to comment.