Srushtibob123 commited on
Commit
971cbb9
1 Parent(s): 5824bdf

Upload 29 files

Browse files
.gitattributes CHANGED
@@ -1,35 +1,40 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ IMG20200208155319.jpg filter=lfs diff=lfs merge=lfs -text
37
+ prob[[:space:]](1).gif filter=lfs diff=lfs merge=lfs -text
38
+ side-unscreen[[:space:]](1).gif filter=lfs diff=lfs merge=lfs -text
39
+ side-unscreen[[:space:]](2).gif filter=lfs diff=lfs merge=lfs -text
40
+ videocon-unscreen[[:space:]](1).gif filter=lfs diff=lfs merge=lfs -text
Garbage_sorting_set-removebg-preview (1).png ADDED
IMG20200208155319.jpg ADDED

Git LFS Details

  • SHA256: 23a6f85f2c1213257c8af7a4d8216c1f6b2ede3648df62d0c9425add9f79dc5e
  • Pointer size: 132 Bytes
  • Size of remote file: 3.87 MB
Pastel (1).gif ADDED
Pastel Nature Illustrative Environment Presentation (1) (1).gif ADDED
Priyanka.jpg ADDED
RBTL21IT010.jpg ADDED
README.md CHANGED
@@ -1,13 +1,13 @@
1
- ---
2
- title: WasteDetection
3
- emoji: 🌖
4
- colorFrom: yellow
5
- colorTo: red
6
- sdk: streamlit
7
- sdk_version: 1.35.0
8
- app_file: app.py
9
- pinned: false
10
- license: cc
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ ---
2
+ title: WasteDetection
3
+ emoji: 🌖
4
+ colorFrom: yellow
5
+ colorTo: red
6
+ sdk: streamlit
7
+ sdk_version: 1.35.0
8
+ app_file: app.py
9
+ pinned: false
10
+ license: cc
11
+ ---
12
+
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Srushti.jpg ADDED
Train ADDED
The diff for this file is too large to render. See raw diff
 
Train_(2) (1) (1).ipynb ADDED
The diff for this file is too large to render. See raw diff
 
Untitled-1.bat ADDED
File without changes
app.py ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from PIL import Image
3
+ import numpy as np
4
+
5
+ from ultralytics import YOLO
6
+ from io import BytesIO
7
+ # Initialize session state
8
+
9
+ if "page" not in st.session_state:
10
+ st.session_state.page = "Home"
11
+
12
+ # Load the YOLO model with pre-trained weights
13
+ model_path = r"runs\classify\train4\weights\best.pt" # Use raw string
14
+ model = YOLO(model_path)
15
+
16
+ # Define the function to make predictions
17
+ def make_predictions(image_data):
18
+ image = Image.open(BytesIO(image_data))
19
+ results = model(image)
20
+ names_dict = results[0].names
21
+ probs = results[0].probs.data.tolist()
22
+ predicted_item_class = names_dict[np.argmax(probs)].split('_')[0]
23
+ predicted_category = names_dict[np.argmax(probs)].split('_')[1]
24
+ return image, predicted_item_class, predicted_category
25
+
26
+ # Define the function to capture photo and perform waste classification
27
+ def take_photo_and_classify():
28
+ picture = st.camera_input("Take a picture")
29
+
30
+ if picture:
31
+ # Make prediction
32
+ image, predicted_item_class, predicted_category = make_predictions(picture.getvalue())
33
+
34
+ # Display the captured image and prediction
35
+ st.image(image, caption='Captured Image')
36
+ st.write('Predicted Waste Item Class:', predicted_item_class)
37
+ st.write('Predicted Waste Category:', predicted_category)
38
+ else:
39
+ st.warning("No image captured.")
40
+
41
+ # Define the footer content
42
+ def sidebar_footer():
43
+ st.sidebar.markdown("---")
44
+ st.sidebar.markdown("<div style='text-align: center; font-size: 12px; font-family: Times New Roman; margin-bottom: 5px;'>Medical waste detection and classification</div>", unsafe_allow_html=True)
45
+ st.sidebar.markdown("<div style='text-align: center; font-size: 12px; font-family: Times New Roman;'>Omkar Bhalerao | Srushti Bobe | Priyanka Adhav</div>", unsafe_allow_html=True)
46
+
47
+ st.sidebar.image(r"side-unscreen (1).gif", use_column_width=True)
48
+
49
+ # Center-align sidebar content and add space after the line
50
+ st.sidebar.markdown("<div style='text-align: center; margin-bottom: 30px;'>"
51
+ "<b>Exploring pathways to innovation and knowledge.</b>"
52
+ "</div>", unsafe_allow_html=True)
53
+
54
+ nav_options = ["🏠 Home", "📝 Problem" , "🔧 Working", "📊 Classification", "👩‍💻 About"]
55
+ icons = ["➜", "➜", "➜", "➜", "➜"]
56
+ for option, icon in zip(nav_options, icons):
57
+ if st.sidebar.button(f"{icon} {option}", key=option):
58
+ st.session_state.page = option.split()[1]
59
+ sidebar_footer()
60
+
61
+ # Render the content based on the selected page
62
+ if st.session_state.page == "Home":
63
+ st.markdown("<h1 style='text-align: center;'>Medical Waste Detection and Classification</h1>", unsafe_allow_html=True)
64
+ st.write("<p style='text-align:center; font-family:Charmonman'><b>Empowering Health, Protecting Tomorrow: Innovating Medical Waste Detection and Classification</b></p>", unsafe_allow_html=True)
65
+ st.image(r"im1 (1).jpg", use_column_width=True)
66
+ st.write("<p style='text-align:justify'>Efficient detection and careful sorting of medical waste are crucial for protecting healthcare workers, patients, and the environment. That's why we are making a system that detects different types of medical waste, such as bandages, syringes, saline bottles, cardboard, pill packets, gloves, masks, and PPE kits, and classifies them according to their particular type, such as infectious waste, pharmaceutical waste, and non-hazardous waste. This ensures that each type of waste is sorted carefully, reducing the risk of contamination and ensuring compliance with regulations. Strong detection and sorting systems not only prevent health and environmental risks but also show a commitment to responsible medical waste management.</p>", unsafe_allow_html=True)
67
+
68
+ elif st.session_state.page == "Problem":
69
+ st.title("Problem Statement")
70
+ st.write("<p style='text-align:justify'>Inadequate knowledge about medical waste types and management often leads people to dispose of their waste improperly, resulting in mixed garbage that poses challenges for waste collectors during sorting, especially when dealing with hazardous materials.</p>", unsafe_allow_html=True)
71
+ st.image(r"prob (1).gif",use_column_width=True)
72
+ st.write("<p style='text-align:justify'>Our solution aims to address this issue by encouraging individuals to segregate their waste according to predefined classifications at the source. Our system facilitates waste classification, providing assistance to individuals who may not be familiar with waste types, thereby promoting proper waste management practices.</p>", unsafe_allow_html=True)
73
+
74
+
75
+ elif st.session_state.page == "Working":
76
+ st.title("System Overview")
77
+ st.write("<p style='text-align:justify'>The outlined process describes a robust system for medical waste detection and classification, ensuring the efficient and safe management of medical waste.</p>", unsafe_allow_html=True)
78
+ st.image(r"Pastel (1).gif")
79
+ st.write("<p style='text-align:justify'>The process of medical waste detection and classification initiates with the Input stage, where an image is acquired either through a camera capture or by uploading an existing image file. Once the image is acquired, it proceeds to the Upload phase, where it is transmitted to the system for further analysis. Upon reaching the Detect Image stage, the YOLOv8 object detection algorithm is deployed. YOLOv8 meticulously scrutinizes the image, identifying various objects present within it.</p>", unsafe_allow_html=True)
80
+ st.write("<p style='text-align:justify'>Upon detection, the system classifies these items into four distinct categories: Infectious, Pharmaceutical, Sharps, and Non-Hazardous waste. Specifically:.</p>", unsafe_allow_html=True)
81
+
82
+ # List of items
83
+ items = [
84
+ "Gloves are classified as Infectious waste.",
85
+ "Pill Packets fall under the Pharmaceutical category.",
86
+ "Masks are categorized as Infectious waste.",
87
+ "Syringes are identified as Sharps.",
88
+ "Saline Bottles are classified as Non-Hazardous waste.",
89
+ "PPE Kits are categorized as Infectious waste.",
90
+ "Bandages are classified as Infectious waste.",
91
+ "Cardboard is identified as Non-Hazardous waste."
92
+ ]
93
+
94
+ # Create an unordered list
95
+ st.write("<ul>", unsafe_allow_html=True)
96
+
97
+ # Add list items
98
+ for item in items:
99
+ st.write(f"<li>{item}</li>", unsafe_allow_html=True)
100
+
101
+ # Close the unordered list
102
+ st.write("</ul>", unsafe_allow_html=True)
103
+
104
+ st.write("<p style='text-align:justify'>This classification enables proper handling, disposal, or treatment based on the hazard level and type of medical waste identified from the input image. By accurately detecting and sorting various types of waste materials using YOLOv8, the system facilitates the efficient and safe management of medical waste, ultimately contributing to improved healthcare waste management practices.</p>", unsafe_allow_html=True)
105
+
106
+ elif st.session_state.page == "Classification":
107
+ st.markdown("<h1 style='text-align: center;'>Medical Waste Detection and Classification</h1>", unsafe_allow_html=True)
108
+ st.image(r"videocon-unscreen (1).gif", use_column_width=True)
109
+
110
+ # Streamlit app section for capturing photo and making predictions
111
+ st.markdown("<h4 style='text-align: center;'>Take a Picture for Prediction</h4>", unsafe_allow_html=True)
112
+ st.write(" ➜ Take Picture")
113
+ take_photo_and_classify()
114
+
115
+
116
+ # Streamlit app section for uploading an image and making predictions
117
+ st.markdown("<h4 style='text-align: center;'>Upload an Image for Prediction</h4>", unsafe_allow_html=True)
118
+ st.write(" ➜ Select Your Image")
119
+ uploaded_file = st.file_uploader("Choose a file", type=["jpg", "jpeg", "png"])
120
+
121
+ if uploaded_file is not None:
122
+ # Save the uploaded file
123
+ image_path = 'uploaded_image.jpg'
124
+ with open(image_path, 'wb') as f:
125
+ f.write(uploaded_file.getvalue())
126
+
127
+ st.success('File uploaded and saved to {}'.format(image_path))
128
+
129
+ # Read the uploaded file as bytes
130
+ image_bytes = uploaded_file.read()
131
+
132
+ # Make prediction
133
+ image, predicted_item_class, predicted_category = make_predictions(image_bytes)
134
+
135
+ # Display the prediction
136
+ st.subheader('Prediction:')
137
+ st.write('Predicted Waste Item Class:', predicted_item_class)
138
+ st.write('Predicted Waste Category:', predicted_category)
139
+
140
+ # Display the uploaded image
141
+ st.subheader('Uploaded Image:')
142
+ st.image(image)
143
+
144
+ elif st.session_state.page == "About":
145
+ st.title("About Us")
146
+
147
+ st.write("<p style='text-align:justify'>We are a team of enthusiastic students from JSPM's Rajarshi Shahu College of Engineering, Pune, pursuing our Bachelor of Technology (B.Tech) in Information Technology. Passionate about technology and innovation, we come together to explore and create solutions that make a positive impact on the world around us.</p>", unsafe_allow_html=True)
148
+ st.write(" ")
149
+ # Set up a single-column layout for the first row
150
+ col1, col2, col3 = st.columns(3)
151
+
152
+ # Your photo and name
153
+ with col1:
154
+ st.image(r"RBTL21IT010.jpg", use_column_width=True)
155
+ st.write("<p style='text-align:center'>Omkar Bhalerao <br><a href='mailto:omkarbhalerao2002@gmail.com'>omkarbhalerao2002@gmail.com</a></p>", unsafe_allow_html=True)
156
+
157
+ # Group member 1 photo and name
158
+ with col2:
159
+ st.image(r"Srushti.jpg", use_column_width=True)
160
+ st.write("<p style='text-align:center'>Srushti Bobe<br><a href='mailto:bobesrushti9146@gmail.com'>bobesrushti9146@gmail.com</a></p>", unsafe_allow_html=True)
161
+
162
+ # Group member 2 photo and name
163
+ with col3:
164
+ st.image(r"Priyanka.jpg", use_column_width=True)
165
+ st.write("<p style='text-align:center'>Priyanka Adhav <br><a href='mailto:adhavpriyanka44@gmail.com'>adhavpriyanka44@gmail.com</a></p>", unsafe_allow_html=True)
166
+ st.write(" ")
167
+
168
+
169
+ st.write("<p style='text-align:justify'>As students of Rajarshi Shahu College of Engineering, we have access to state-of-the-art facilities and a dynamic learning environment that encourages innovation and collaboration. Our diverse backgrounds and experiences enrich our projects and enable us to approach problems from different perspectives.</p>", unsafe_allow_html=True)
170
+
171
+ st.write("Please contact us for more information.")
best.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6e026dcb8d062f9797988f47ecafc9f7c036dcb227786c74417e641320020bb
3
+ size 31698841
im1 (1).jpg ADDED
photo.jpg ADDED
prob (1).gif ADDED

Git LFS Details

  • SHA256: 0549aa512af4bff12b1d9c31180bb254c1fbf6c0cbbe5b29f73f53585d69a6a0
  • Pointer size: 132 Bytes
  • Size of remote file: 2.1 MB
requirements.txt ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ altair==5.3.0
2
+ attrs==23.2.0
3
+ blinker==1.8.2
4
+ cachetools==5.3.3
5
+ certifi==2024.2.2
6
+ charset-normalizer==3.3.2
7
+ click==8.1.7
8
+ colorama==0.4.6
9
+ contourpy==1.2.1
10
+ cycler==0.12.1
11
+ filelock==3.14.0
12
+ fonttools==4.52.4
13
+ fsspec==2024.5.0
14
+ gitdb==4.0.11
15
+ GitPython==3.1.43
16
+ idna==3.7
17
+ importlib_resources==6.4.0
18
+ intel-openmp==2021.4.0
19
+ Jinja2==3.1.4
20
+ jsonschema==4.22.0
21
+ jsonschema-specifications==2023.12.1
22
+ kiwisolver==1.4.5
23
+ markdown-it-py==3.0.0
24
+ MarkupSafe==2.1.5
25
+ matplotlib==3.9.0
26
+ mdurl==0.1.2
27
+ mkl==2021.4.0
28
+ mpmath==1.3.0
29
+ networkx==3.2.1
30
+ numpy==1.26.4
31
+ opencv-python==4.9.0.80
32
+ packaging==24.0
33
+ pandas==2.2.2
34
+ pillow==10.3.0
35
+ protobuf==4.25.3
36
+ psutil==5.9.8
37
+ py-cpuinfo==9.0.0
38
+ pyarrow==16.1.0
39
+ pydeck==0.9.1
40
+ Pygments==2.18.0
41
+ pyparsing==3.1.2
42
+ python-dateutil==2.9.0.post0
43
+ pytz==2024.1
44
+ PyYAML==6.0.1
45
+ referencing==0.35.1
46
+ requests==2.32.2
47
+ rich==13.7.1
48
+ rpds-py==0.18.1
49
+ scipy==1.13.1
50
+ seaborn==0.13.2
51
+ six==1.16.0
52
+ smmap==5.0.1
53
+ streamlit==1.35.0
54
+ sympy==1.12
55
+ tbb==2021.12.0
56
+ tenacity==8.3.0
57
+ thop==0.1.1.post2209072238
58
+ toml==0.10.2
59
+ toolz==0.12.1
60
+ torch==2.3.0
61
+ torchvision==0.18.0
62
+ tornado==6.4
63
+ tqdm==4.66.4
64
+ typing_extensions==4.12.0
65
+ tzdata==2024.1
66
+ ultralytics==8.2.23
67
+ urllib3==2.2.1
68
+ watchdog==4.0.1
69
+ zipp==3.19.0
side (1).jpg ADDED
side-unscreen (1).gif ADDED

Git LFS Details

  • SHA256: 61e13e781c0634d668bf040aa477dd4e958b990a73e63073fafe71711a011205
  • Pointer size: 132 Bytes
  • Size of remote file: 1.5 MB
side-unscreen (2).gif ADDED

Git LFS Details

  • SHA256: 61e13e781c0634d668bf040aa477dd4e958b990a73e63073fafe71711a011205
  • Pointer size: 132 Bytes
  • Size of remote file: 1.5 MB
sl.jpg ADDED
syringe.m ADDED
Binary file (4.18 kB). View file
 
syringe_sample.jpg ADDED
uploaded_image.jpg ADDED
videocon (1).gif ADDED
videocon-unscreen (1).gif ADDED

Git LFS Details

  • SHA256: 68bf310fe2dcc5433fdbc399cc882a6b6e4fa2a64fe817a90d5f03eaa6f2847f
  • Pointer size: 132 Bytes
  • Size of remote file: 1.6 MB
yolov8m-cls.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65f5d0df8a67e48dc0a3fc7d50cdfb800c2eb153f26c659fa3cbe7cabf2313f9
3
+ size 34270382
yolov8n.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31e20dde3def09e2cf938c7be6fe23d9150bbbe503982af13345706515f2ef95
3
+ size 6534387