Skip to content

Commit

Permalink
Merge pull request #59 from dominikkawka/consoleLog
Browse files Browse the repository at this point in the history
removed console.logs
  • Loading branch information
dominikkawka authored Apr 21, 2024
2 parents 5d570a0 + b1c4cbb commit 679a4f9
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ If you wish to use your GPU to build the model yourself, please follow [this gui

#### Other

I haven't uploaded the model itself since there seems to be a bug with git lfs, when downloaded the model is corrupted. In backend, create a folder named model and insert the model from this [google drive download link](https://drive.google.com/file/d/1mxr1Mmtp8ZQqLGGpO7450eUxIrJlQlKk/view?usp=sharing).
I haven't uploaded the model itself since there seems to be a bug with git lfs, when downloaded the model is corrupted. In backend, create a folder named model and insert the model from this [google drive download link](https://drive.google.com/file/d/1msjLsnz-Zqua8dRYwe3HL2ofQ36XA5GR/view?usp=sharing).
2 changes: 1 addition & 1 deletion backend/loadRunModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from backend import commonVariables as val

def modelPrediction(dogBreedImage):
loadModel = load_model('model/InceptionV3-2.15-22Mar-122-Augmented.h5') #backend/model/InceptionV3-2.15-22Mar-122-Augmented.h5
loadModel = load_model('backend/model/InceptionV3-2.15-22Mar-122-Augmented.h5') #backend/model/InceptionV3-2.15-22Mar-122-Augmented.h5
#convert image

valueBreed = tf.keras.utils.load_img(dogBreedImage, target_size=(val.image_size,val.image_size))
Expand Down
12 changes: 1 addition & 11 deletions frontend/src/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const uploadImage = async (image) => {
const response = await axios.post(`${import.meta.env.VITE_API_URL}/uploadImage`, formData);
return response.data;
} catch (error) {
console.error('Error uploading image:', error);
throw error;
}
};
Expand All @@ -22,7 +21,6 @@ const getPrediction = async (imageName) => {
});
return response.data;
} catch (error) {
console.error('Error fetching prediction:', error);
throw error;
}
};
Expand All @@ -36,10 +34,7 @@ const patchCorrectBreed = async (predictedBreed, imageName, actualBreed) => {
});
return response.data;
} catch (error) {
console.error('Error patching correct breed:', error);
console.log("prediction: "+ predictedBreed)
console.log("image name: "+ imageName)
console.log("actualBreed: "+ actualBreed)

throw error;
}
};
Expand All @@ -53,10 +48,6 @@ const patchUsernameToPrediction = async (predictedBreed, imageName, username) =>
});
return response.data;
} catch (error) {
console.error('Error patching correct breed:', error);
console.log("prediction: "+ predictedBreed)
console.log("image name: "+ imageName)
console.log("username: "+ username)
throw error;
}
}
Expand All @@ -71,7 +62,6 @@ const loginUser = async (username, password) => {
localStorage.setItem('token', response.data.access_token)
sessionStorage.setItem('username', username)
window.location.replace(`/`)
//console.log(response.data)
return response.data
} catch (error) {
throw error
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/components/DragDropImage/dragDropImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export default function DragDropImage() {
setImagePreview(URL.createObjectURL(selectedImage));
} else {
setUploadError('Unsupported file type. Please upload a PNG or JPEG image.')
console.error('Unsupported file type. Please upload a PNG or JPEG image.');
}
};

Expand All @@ -68,7 +67,6 @@ export default function DragDropImage() {
setConfidence2(parseFloat(response.secondConfidence) || 0);
setPrediction3(response.thirdPredictedBreed || '');
setConfidence3(parseFloat(response.thirdConfidence) || 0);
console.log((confidence + confidence2 + confidence3))
} catch (error) {
// Handle error
}
Expand Down Expand Up @@ -112,9 +110,6 @@ export default function DragDropImage() {
if (response) {
}
} catch (error) {
//console.log("prediction: "+ prediction)
//console.log("image name: "+ image.name)
//console.log("actualBreed: "+ actualBreed)
}
};

Expand Down Expand Up @@ -252,7 +247,6 @@ export default function DragDropImage() {
});
} else {
setValue(newValue);
console.log('newValue: '+ JSON.stringify(newValue))
}
}}
filterOptions={(options, params) => {
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/components/FileForm/FileForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ function FileForm() {
if (response) {
}
} catch (error) {
//console.log("prediction: "+ prediction)
//console.log("image name: "+ image.name)
//console.log("actualBreed: "+ actualBreed)
}
};

Expand Down Expand Up @@ -169,7 +166,6 @@ function FileForm() {
});
} else {
setValue(newValue);
console.log('newValue: '+ JSON.stringify(newValue))
}
}}
filterOptions={(options, params) => {
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/HomeStats/homeStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function HomeStats() {
const fetchAllPredictions = async () => {
try {
const response = await axios.get(`${import.meta.env.VITE_API_URL}/allPredictions`);
console.log(response.data);
setAmount(response.data.length);
} catch (error) {
setAmount(301)
Expand All @@ -29,7 +28,6 @@ export default function HomeStats() {
const fetchUserPredictions = async () => {
try {
const response = await axios.get(`${import.meta.env.VITE_API_URL}/allUsers`);
console.log(response.data);
setUserAmount(response.data.length);
} catch (error) {
setUserAmount(301)
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/NavigationBar/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const SiteHeader = ({ }) => {
const navigate = useNavigate();

let username = sessionStorage.getItem("username")
console.log("logged in as..." + username)

const logout = () => {
sessionStorage.removeItem("username")
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/components/WebcamFeed/WebcamFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ function WebcamFeed() {
imageName: imageName,
})
.then((r) => {
console.log(r.status);
//console.log(r.status);
setProgressVisible(false);
})
.catch((e) => console.log(e));
//console.log(splitImgMetaData);
.catch((e) => console.log(''));
setViewPrediction(true)
} catch (error) {
setViewPrediction(true)
Expand All @@ -81,7 +80,6 @@ function WebcamFeed() {
setConfidence2(parseFloat(response.secondConfidence) || 0);
setPrediction3(response.thirdPredictedBreed || '');
setConfidence3(parseFloat(response.thirdConfidence) || 0);
console.log((confidence + confidence2 + confidence3))
} catch (error) {
// Handle error
}
Expand Down Expand Up @@ -241,7 +239,6 @@ function WebcamFeed() {
});
} else {
setValue(newValue);
console.log('newValue: '+ JSON.stringify(newValue))
}
}}
filterOptions={(options, params) => {
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/pages/AboutPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const AboutPage = () => {
const fetchAllPredictions = async () => {
try {
const response = await axios.get(`${import.meta.env.VITE_API_URL}/allPredictions`);
console.log(response.data);
setAmount(response.data.length);
} catch (error) {
setAmount("?")
Expand All @@ -18,7 +17,6 @@ const AboutPage = () => {
const fetchUserPredictions = async () => {
try {
const response = await axios.get(`${import.meta.env.VITE_API_URL}/allUsers`);
console.log(response.data);
setUserAmount(response.data.length);
} catch (error) {
setUserAmount("?")
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/pages/DogDescriptionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const DogDescriptionPage: React.FC = () => {
const result = await getDescription(breedName);
setDescription(result);
} catch (error) {
console.error('Error fetching description:', error);
}
};

Expand All @@ -57,10 +56,8 @@ const DogDescriptionPage: React.FC = () => {
},
});

console.log(response.data);
return response.data;
} catch (error) {
console.error('Error fetching description:', error);
throw error;
}
};
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/pages/HistoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const HistoryPage = () => {
token: token
},
});
console.log(response.data);
setPredictions(response.data);
setProgressCircle(false)
} catch (error) {
Expand All @@ -34,7 +33,6 @@ const HistoryPage = () => {
image: image
}
})
console.log(response.data);
await fetchUserPredictions()
} catch (error) {
await fetchUserPredictions()
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/signinPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default function SignInSide() {
} catch (error) {
if (error instanceof AxiosError) {
let errorMessage = error.response?.data.detail;
console.log(errorMessage)
if (!username || !password) {
setErrorMessage("Username or password cannot be empty");
} else {
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/pages/signupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ export default function SignUp() {
} catch (error) {
if (error instanceof AxiosError) {
let errorMessage = error.response?.data.detail;
console.log(errorMessage)
setErrorMessage(JSON.stringify(errorMessage))
} else {
setErrorMessage("Unknown Error Occured")
}
}
//console.log(username, email, password);
};

return (
Expand Down

0 comments on commit 679a4f9

Please sign in to comment.