Rudra-barman commited on
Commit
4afb608
·
verified ·
1 Parent(s): a2ef13e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -13
app.py CHANGED
@@ -443,23 +443,16 @@ if page == "🏠 Home & Classification":
443
  type=['jpg', 'jpeg', 'png', 'bmp', 'webp'],
444
  help="Upload a clear image of the waste item"
445
  )
446
-
447
- # Camera input option
448
- camera_image = st.camera_input("Or take a photo")
449
-
450
- # Use camera image if available, otherwise use uploaded file
451
- if camera_image is not None:
452
- image = Image.open(camera_image)
453
- st.success("✅ Photo captured successfully!")
454
- elif uploaded_file is not None:
455
- image = Image.open(uploaded_file)
456
  st.success("✅ Image uploaded successfully!")
457
  else:
458
  image = None
459
- st.info("👆 Please upload an image or take a photo to begin")
460
-
461
  st.markdown('</div>', unsafe_allow_html=True)
462
-
463
  # Display uploaded image
464
  if image is not None:
465
  st.markdown('<div class="card">', unsafe_allow_html=True)
 
443
  type=['jpg', 'jpeg', 'png', 'bmp', 'webp'],
444
  help="Upload a clear image of the waste item"
445
  )
446
+
447
+ if uploaded_file is not None:
448
+ image = Image.open(uploaded_file).convert("RGB")
 
 
 
 
 
 
 
449
  st.success("✅ Image uploaded successfully!")
450
  else:
451
  image = None
452
+ st.info("👆 Please upload an image to begin")
453
+
454
  st.markdown('</div>', unsafe_allow_html=True)
455
+
456
  # Display uploaded image
457
  if image is not None:
458
  st.markdown('<div class="card">', unsafe_allow_html=True)