hari3485 commited on
Commit
11f9713
·
verified ·
1 Parent(s): c666782

Update pages/Data Collection.py

Browse files
Files changed (1) hide show
  1. pages/Data Collection.py +49 -49
pages/Data Collection.py CHANGED
@@ -508,55 +508,55 @@ def image_details_page():
508
  - **In images**: Each row represents a set of data points (pixels), and the columns represent their features.
509
  - **In tables**:Each row represents an individual data point, and each column corresponds to a feature of that data point.
510
  """)
511
-
512
- st.header("Color Spaces")
513
-
514
- # Explanation for Color Spaces
515
- st.write("""
516
- Color space is a technique used to represent the colors of an image. This technique helps us preserve the colors while converting them into numerical values, which machine learning models can understand.
517
-
518
- For example, in image classification tasks like differentiating between dogs and cats:
519
- - The first step is to collect a bunch of dog and cat images. These images may be in formats such as PNG, JPG, or JPEG.
520
- - However, machine learning models can only understand numbers, so color spaces are used to convert the image colors into numerical representations.
521
- """)
522
-
523
- # Subheading for Black and White color space
524
- st.subheader("1. Black and White")
525
- st.write("""
526
- - Represents only two colors: **Black (0)** and **White (255)**.
527
- - Used for simple image processing tasks where color isn't essential.
528
- - **Disadvantage**: It only preserves black and white, so other colors (like red, green, or brown) are completely lost.
529
- - For example, by using the image's width and height (rows and columns), we can create a **2D array** where each pixel is represented by either 0 (black) or 255 (white).
530
- - **Use case**: Binary classification problems like simple object detection, where only the presence or absence of a feature matters.
531
- """)
532
-
533
- # Subheading for Grayscale color space
534
- st.subheader("2. Grayscale")
535
- st.write("""
536
- - Extends black and white to include **256 shades of gray**.
537
- - Preserves brightness details but loses color information.
538
- - **Disadvantage**: If the image has colors like red, green, or brown, it cannot preserve those since grayscale only represents shades of gray.
539
- - After converting an image to grayscale, each pixel can take values from 0 (black) to 255 (white), with every intermediate value representing a shade of gray.
540
- - **Use case**: Applications where only intensity (brightness) matters, like edge detection or certain medical imaging applications.
541
- """)
542
-
543
- # Subheading for RGB color space
544
- st.subheader("3. RGB (Red, Green, Blue)")
545
- st.write("""
546
- - Combines three color channels: **Red**, **Green**, and **Blue**.
547
- - Each channel can represent **256 shades** (0-255).
548
- - By mixing different intensities of red, green, and blue, you can create over **16 million possible colors**.
549
- - This is the most commonly used color space for colored images and is widely used in digital displays, cameras, and image processing tasks.
550
- - In RGB color space, each pixel is represented by three values, one for each channel (Red, Green, Blue). The image is represented as a **3D array** where each pixel has three values (R, G, B).
551
- - **Disadvantage**: It requires more data (3 values per pixel), which can be computationally intensive.
552
- """)
553
-
554
- # Connecting the concepts
555
- st.subheader("Key Differences Between 2D and 3D Arrays in Color Spaces")
556
- st.write("""
557
- - **2D Arrays**: Used in Black and White or Grayscale color spaces. Each pixel is represented by a single value (black/white or a shade of gray).
558
- - **3D Arrays**: Used in RGB color space, where each pixel is represented by three values (Red, Green, Blue), forming a 3D structure of the image.
559
- """)
560
 
561
  # Basic Operations Section
562
  elif page =="Basic Operations":
 
508
  - **In images**: Each row represents a set of data points (pixels), and the columns represent their features.
509
  - **In tables**:Each row represents an individual data point, and each column corresponds to a feature of that data point.
510
  """)
511
+
512
+ st.header("Color Spaces")
513
+
514
+ # Explanation for Color Spaces
515
+ st.write("""
516
+ Color space is a technique used to represent the colors of an image. This technique helps us preserve the colors while converting them into numerical values, which machine learning models can understand.
517
+
518
+ For example, in image classification tasks like differentiating between dogs and cats:
519
+ - The first step is to collect a bunch of dog and cat images. These images may be in formats such as PNG, JPG, or JPEG.
520
+ - However, machine learning models can only understand numbers, so color spaces are used to convert the image colors into numerical representations.
521
+ """)
522
+
523
+ # Subheading for Black and White color space
524
+ st.subheader("1. Black and White")
525
+ st.write("""
526
+ - Represents only two colors: **Black (0)** and **White (255)**.
527
+ - Used for simple image processing tasks where color isn't essential.
528
+ - **Disadvantage**: It only preserves black and white, so other colors (like red, green, or brown) are completely lost.
529
+ - For example, by using the image's width and height (rows and columns), we can create a **2D array** where each pixel is represented by either 0 (black) or 255 (white).
530
+ - **Use case**: Binary classification problems like simple object detection, where only the presence or absence of a feature matters.
531
+ """)
532
+
533
+ # Subheading for Grayscale color space
534
+ st.subheader("2. Grayscale")
535
+ st.write("""
536
+ - Extends black and white to include **256 shades of gray**.
537
+ - Preserves brightness details but loses color information.
538
+ - **Disadvantage**: If the image has colors like red, green, or brown, it cannot preserve those since grayscale only represents shades of gray.
539
+ - After converting an image to grayscale, each pixel can take values from 0 (black) to 255 (white), with every intermediate value representing a shade of gray.
540
+ - **Use case**: Applications where only intensity (brightness) matters, like edge detection or certain medical imaging applications.
541
+ """)
542
+
543
+ # Subheading for RGB color space
544
+ st.subheader("3. RGB (Red, Green, Blue)")
545
+ st.write("""
546
+ - Combines three color channels: **Red**, **Green**, and **Blue**.
547
+ - Each channel can represent **256 shades** (0-255).
548
+ - By mixing different intensities of red, green, and blue, you can create over **16 million possible colors**.
549
+ - This is the most commonly used color space for colored images and is widely used in digital displays, cameras, and image processing tasks.
550
+ - In RGB color space, each pixel is represented by three values, one for each channel (Red, Green, Blue). The image is represented as a **3D array** where each pixel has three values (R, G, B).
551
+ - **Disadvantage**: It requires more data (3 values per pixel), which can be computationally intensive.
552
+ """)
553
+
554
+ # Connecting the concepts
555
+ st.subheader("Key Differences Between 2D and 3D Arrays in Color Spaces")
556
+ st.write("""
557
+ - **2D Arrays**: Used in Black and White or Grayscale color spaces. Each pixel is represented by a single value (black/white or a shade of gray).
558
+ - **3D Arrays**: Used in RGB color space, where each pixel is represented by three values (Red, Green, Blue), forming a 3D structure of the image.
559
+ """)
560
 
561
  # Basic Operations Section
562
  elif page =="Basic Operations":