Skip to content

Commit

Permalink
object detection
Browse files Browse the repository at this point in the history
  • Loading branch information
tahmid-saj committed Jun 16, 2024
1 parent 4289e7d commit 7333b1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const UploadImage = () => {

setFormFields({
...formFields,
uploadedImage: name === "uploadedImagePath" ? URL.createObjectURL(event.target.files[0]) : "",
uploadedImage: name === "uploadedImagePath" ? event.target.files[0] : "",
[name]: value }
);

Expand Down Expand Up @@ -97,7 +97,7 @@ const UploadImage = () => {
<FormInput label="Image URL" type="url" id="imageUrl" name="imageUrl"
onChange={ (e) => handleChange(e, NUTRIENT_PREDICTOR_ENUMS.url) } value={ formFields.imageUrl }></FormInput>

<FormInput type="file" id="uploadedImagePath" name="uploadedImagePath"
<FormInput disabled type="file" id="uploadedImagePath" name="uploadedImagePath"
onChange={ (e) => handleChange(e, NUTRIENT_PREDICTOR_ENUMS.image) } value={ formFields.uploadedImagePath } accept="image/*"></FormInput>

<ButtonsContainer>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/api-requests/nutrient-predictor.requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const getFoodObjectDetection = async (uploadedImage) => {
const resFoodObjectDetection = await fetch(`${process.env.REACT_APP_API_URL_OBJECT_DETECTOR}${process.env.REACT_APP_API_URL_FOOD_OBJECT_DETECTION}`, {
method: "POST",
headers: {
"Content-Type": "multipart/form-data"
"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
},
body: formData
})
Expand Down

0 comments on commit 7333b1f

Please sign in to comment.