sree4411 commited on
Commit
efb06fa
·
verified ·
1 Parent(s): b8b914d

Update pages/3_Life Cycle Of ML Project.py

Browse files
Files changed (1) hide show
  1. pages/3_Life Cycle Of ML Project.py +48 -48
pages/3_Life Cycle Of ML Project.py CHANGED
@@ -189,65 +189,65 @@ elif st.session_state.page == "unstructured_data":
189
  elif st.session_state.page == "Introduction_to_image":
190
  st.header("🖼️ What is Image")
191
  st.markdown("""
192
- An image is a two-dimensional visual representation of objects, people, scenes, or concepts. It can be captured using devices like cameras, scanners, or created digitally. Images are composed of individual units called pixels, which contain information about brightness and color.
193
- Types of Images:
194
- - **Raster Images (Bitmap)**: Composed of a grid of pixels. Common formats include:
195
  - JPEG
196
  - PNG
197
  - GIF
198
- - **Vector Images**: Defined by mathematical equations and geometric shapes like lines and curves. Common format:
199
  - SVG (Scalable Vector Graphics)
200
- - **3D Images**: Represent objects or scenes in three dimensions, often used for rendering and modeling.
201
- Image Representation:
202
- - **Grayscale Image**: Each pixel has a single intensity value, typically ranging from 0 (black) to 255 (white), representing different shades of gray.
203
- - **Color Image**: Usually represented in the RGB color space, where each pixel consists of three values indicating the intensity of Red, Green, and Blue.
204
- Applications of Images:
205
- - **Photography & Visual Media**: Capturing moments and storytelling.
206
- - **Medical Imaging**: Diagnosing conditions using X-rays, MRIs, etc.
207
- - **Machine Learning & AI**: Tasks like image classification, object detection, and facial recognition.
208
- - **Remote Sensing**: Analyzing geographic and environmental data using satellite imagery.
209
- - **Graphic Design & Art**: Creating creative visual content for marketing and design.
210
- """)
211
 
212
  st.code("""
213
- from PIL import Image
214
- import numpy as np
215
- import matplotlib.pyplot as plt
216
- # Open an image file
217
- image = Image.open('sample_image.jpg')
218
- image.show()
219
- # Convert image to grayscale
220
- gray_image = image.convert('L')
221
- gray_image.show()
222
- # Resize the image
223
- resized_image = image.resize((200, 200))
224
- resized_image.show()
225
- # Rotate the image by 90 degrees
226
- rotated_image = image.rotate(90)
227
- rotated_image.show()
228
- # Convert the image to a NumPy array and display its shape
229
- image_array = np.array(image)
230
- print(image_array.shape)
231
- # Display the image array as a plot
232
- plt.imshow(image)
233
- plt.title("Original Image")
234
- plt.axis('off')
235
- plt.show()
236
  """, language='python')
237
 
238
  st.header("Color Spaces in Machine Learning")
239
  st.markdown("""
240
  A color space is a mathematical model for representing colors. In machine learning, different color spaces can be used for preprocessing and analyzing image data, depending on the task.
241
- Common Color Spaces:
242
- - **RGB (Red, Green, Blue)**: The most common color space for digital images. Each pixel is represented by a combination of three values corresponding to the red, green, and blue channels.
243
- - **Use Cases**: Image classification, general-purpose image analysis.
244
- - **HSV (Hue, Saturation, Value)**: Separates color information (hue) from intensity (value), making it useful for tasks where distinguishing between color variations and intensity is important.
245
- - **Use Cases**: Color-based object detection, image segmentation, color tracking.
246
- - **CMYK (Cyan, Magenta, Yellow, Black)**: Primarily used for printing, not commonly used in machine learning, but useful for preparing images for printers.
247
- - **Use Cases**: Printing applications.
248
- - **LAB (Lightness, A, B)**: Designed to be perceptually uniform, meaning that the perceptual difference between colors is consistent across the space.
249
- - **Use Cases**: Color correction, image processing tasks requiring color consistency.
250
- """)
251
 
252
  # Button to Navigate to Operations Using OpenCV
253
  if st.button("Operations Using OpenCV"):
 
189
  elif st.session_state.page == "Introduction_to_image":
190
  st.header("🖼️ What is Image")
191
  st.markdown("""
192
+ An image is a two-dimensional visual representation of objects, people, scenes, or concepts. It can be captured using devices like cameras, scanners, or created digitally. Images are composed of individual units called pixels, which contain information about brightness and color.
193
+ Types of Images:
194
+ - **Raster Images (Bitmap)**: Composed of a grid of pixels. Common formats include:
195
  - JPEG
196
  - PNG
197
  - GIF
198
+ - **Vector Images**: Defined by mathematical equations and geometric shapes like lines and curves. Common format:
199
  - SVG (Scalable Vector Graphics)
200
+ - **3D Images**: Represent objects or scenes in three dimensions, often used for rendering and modeling.
201
+ Image Representation:
202
+ - **Grayscale Image**: Each pixel has a single intensity value, typically ranging from 0 (black) to 255 (white), representing different shades of gray.
203
+ - **Color Image**: Usually represented in the RGB color space, where each pixel consists of three values indicating the intensity of Red, Green, and Blue.
204
+ Applications of Images:
205
+ - **Photography & Visual Media**: Capturing moments and storytelling.
206
+ - **Medical Imaging**: Diagnosing conditions using X-rays, MRIs, etc.
207
+ - **Machine Learning & AI**: Tasks like image classification, object detection, and facial recognition.
208
+ - **Remote Sensing**: Analyzing geographic and environmental data using satellite imagery.
209
+ - **Graphic Design & Art**: Creating creative visual content for marketing and design.
210
+ """)
211
 
212
  st.code("""
213
+ from PIL import Image
214
+ import numpy as np
215
+ import matplotlib.pyplot as plt
216
+ # Open an image file
217
+ image = Image.open('sample_image.jpg')
218
+ image.show()
219
+ # Convert image to grayscale
220
+ gray_image = image.convert('L')
221
+ gray_image.show()
222
+ # Resize the image
223
+ resized_image = image.resize((200, 200))
224
+ resized_image.show()
225
+ # Rotate the image by 90 degrees
226
+ rotated_image = image.rotate(90)
227
+ rotated_image.show()
228
+ # Convert the image to a NumPy array and display its shape
229
+ image_array = np.array(image)
230
+ print(image_array.shape)
231
+ # Display the image array as a plot
232
+ plt.imshow(image)
233
+ plt.title("Original Image")
234
+ plt.axis('off')
235
+ plt.show()
236
  """, language='python')
237
 
238
  st.header("Color Spaces in Machine Learning")
239
  st.markdown("""
240
  A color space is a mathematical model for representing colors. In machine learning, different color spaces can be used for preprocessing and analyzing image data, depending on the task.
241
+ Common Color Spaces:
242
+ - **RGB (Red, Green, Blue)**: The most common color space for digital images. Each pixel is represented by a combination of three values corresponding to the red, green, and blue channels.
243
+ - **Use Cases**: Image classification, general-purpose image analysis.
244
+ - **HSV (Hue, Saturation, Value)**: Separates color information (hue) from intensity (value), making it useful for tasks where distinguishing between color variations and intensity is important.
245
+ - **Use Cases**: Color-based object detection, image segmentation, color tracking.
246
+ - **CMYK (Cyan, Magenta, Yellow, Black)**: Primarily used for printing, not commonly used in machine learning, but useful for preparing images for printers.
247
+ - **Use Cases**: Printing applications.
248
+ - **LAB (Lightness, A, B)**: Designed to be perceptually uniform, meaning that the perceptual difference between colors is consistent across the space.
249
+ - **Use Cases**: Color correction, image processing tasks requiring color consistency.
250
+ """)
251
 
252
  # Button to Navigate to Operations Using OpenCV
253
  if st.button("Operations Using OpenCV"):