image
imagewidth (px) 60
350
| label
class label 228
classes |
---|---|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
|
0d0
|
Deep Learning Service Project (Fall 2023)
Getting Started
- Clone the repository with git lfs disabled or not installed.
ON WINDOWS
set GIT_LFS_SKIP_SMUDGE=1
git clone https://huggingface.co/datasets/DataScienceClubUVU/ServiceProjectFall2023
ON LINUX
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datasets/DataScienceClubUVU/ServiceProjectFall2023
Download the pytorch file (.pth) from https://huggingface.co/datasets/DataScienceClubUVU/ServiceProjectFall2023/blob/main/mexico_5_column_weights.pth and place it in the root directory of the repository. There will be an existing file with the same name. Delete it and replace it with the new one.
Install the requirements.txt file using pip.
IF YOU DON't HAVE A GPU
pip install -r requirements_cpu.txt
IF YOU HAVE A GPU
- Install reqs without torch
pip install -r requirements_no_torch.txt
- Install pytorch by following the instructions at https://pytorch.org/get-started/locally/
How the Model Works
- Start with an image of a character of text:
- Convert the image between RGB/BGR and grayscale using the cvtColor function from the cv2 library:
- Use an Adaptive Thresholding approach where the threshold value = Gaussian weighted sum of the neighborhood values - constant value. In other words, it is a weighted sum of the blockSize^2 neighborhood of a point minus the constant. in this example, we are setting the maximum threshold value as 255 with the block size of 155 and the constant is 2.
Create a 3x3 matrix of ones to generate an image kernel. An image kernel is a small matrix used to apply effects like the ones you might find in Photoshop or Gimp, such as blurring, sharpening, outlining or embossing. They're also used in machine learning for 'feature extraction', a technique for determining the most important portions of an image.
The basic idea of erosion is just like soil erosion only, it erodes away the boundaries of foreground object (Always try to keep foreground in white). It is normally performed on binary images. It needs two inputs, one is our original image, second one is called structuring element or kernel which decides the nature of operation. A pixel in the original image (either 1 or 0) will be considered 1 only if all the pixels under the kernel is 1, otherwise it is eroded (made to zero).
- The basic idea of dilation is accentuating the features of the images. Whereas erosion is used to reduce the amount of noise in the image, dilation is used to enhance the features of the image.
- Traditionally, a line can be represented by the equation y=mx + b (where m is the slope and b is the intercept). However, a line can also be represented by the following equation: r= x(cos0) + y(sin0) (where r is the distance from the origin to the closest point on the straight line). (r,0) corresponds corresponds to the Hough space representation of the line. In this case, 0 is known as theta.
- For a given point in a two-dimensional space (think of a basic x- and y-axis graph), there can be an infinite number of straight lines drawn through the point. With a Hough Transform, you draw several lines through the point to create a table of values where you conclude "for given theta (angle between the x-axis and r-line that will match with the closest point on the straight line), we can expect this "r" value".
- Once you have created your table of values for each point on a given two-dimensional space, you compare the r-values on each theta for each given point and select the r and theta where the difference between the point is the least (this means the line best represents the points on the space).
- Downloads last month
- 164