ethanrom commited on
Commit
f50a8e5
·
1 Parent(s): 5b5b64e

Upload 5 files

Browse files
Files changed (3) hide show
  1. image.jpg +0 -0
  2. markup.py +3 -47
  3. requirements.txt +1 -1
image.jpg CHANGED
markup.py CHANGED
@@ -2,12 +2,12 @@ def real_estate_app():
2
  return """
3
  <h3 style='text-align: center;'>Introduction</h3>
4
 
5
- <p>This app allows you to upload an image and remove its background using a custom trained model.</p>
6
 
7
  <h4>Information:</h4>
8
  <ul>
9
  <li><b>Test Detection Algorithm:</b> In this demo you can easily test the accuracy of the detection algorithm by uploading photos with cars and humans </li>
10
- <li><b>Customize and Download Script:</b> You can download the personlized script once done.</li>
11
  </ul>
12
  </div>
13
  """
@@ -16,57 +16,13 @@ def real_estate_app_hf():
16
  return """
17
  <div style='text-align: left;'>
18
  <h3 style='text-align: center;'>About this Demo</h3>
19
- <p>In this demo, the two requested features have been split into two separate tabs for better individual evaluation. They can be combined into one in the final submission.</p>
20
  <br>
21
  <h4>How to use:</h4>
22
  <ul>
23
  <li><b>Testing:</b> Simply upload any image with humans and cars, click apply and predict button</li>
24
- <li><b>Correct Perspective:</b> You can set the destination folder, source folder and other settings to your choice via the GUI and click donwload button to download the finished script.</li>
25
  </ul>
26
  <br>
27
  </div>
28
  """
29
 
30
- def sliders_intro():
31
- return """
32
- <p>Newly added sliders which will appear after an image is uploaded serve as interactive tools to adjust various aspects of the uploaded image. Each slider corresponds to a specific color channel (red, green, blue) or a curve adjustment.
33
- By using these sliders, users can fine-tune the color levels and apply curve modifications to achieve the desired visual effect.</p>
34
- <p>For the RGB Adjustments section, users can use the Red, Green, and Blue sliders to set the minimum and maximum values for each color channel.
35
- By adjusting these values, users can enhance or reduce the intensity of each color channel individually, allowing for precise color adjustments.</p>
36
- <p>In the Curves Adjustment section, users can utilize the Red Curve, Green Curve, and Blue Curve sliders to control the brightness of the respective color channels.
37
- By moving these sliders, users can create custom curves, influencing the overall tone and contrast of the image.</p>
38
- <p>The Masking section offers the Threshold slider, which determines the cutoff point for the transparency mask.
39
- Users can adjust the threshold value to define the boundary between foreground and background elements. This feature enables users to isolate objects by selectively applying transparency to specific areas of the image.</p>
40
- """
41
-
42
- def perspective_intro():
43
- return """
44
- there are two different perspective correction methods you can chose from, the difference is how they determine the transformation matrix used for warping the image.
45
-
46
- In the Four-Point Perspective Correction, the method uses a four-point perspective transform. It first detects lines in the image using the HoughLinesP function, and then calculates the endpoints of these lines.
47
- If enough endpoints are found (at least 4), a convex hull is created based on these endpoints. From the convex hull, a four-sided polygon is obtained, representing the region of interest.
48
- The width and height of this polygon are determined, and a destination set of points is defined to which the polygon will be mapped.
49
- Finally, a perspective transformation matrix is computed using getPerspectiveTransform function, and the image is warped accordingly.
50
-
51
- In the Convex Hull Homography Perspective Correction, a similar process is followed, but instead of using a four-point perspective transform, it uses a homography transform.
52
- After obtaining the endpoints, a convex hull is created, and a four-sided polygon is extracted from it. The width and height of this polygon are calculated, and a destination set of points is defined.
53
- But instead of using getPerspectiveTransform, the findHomography function is used to compute the homography matrix.
54
- This matrix defines the transformation between the source polygon and the destination polygon, and the image is warped using the warpPerspective function.
55
-
56
- The parameters threshold_value, min_line_length, and max_line_gap in both methods control the detection of lines in the image.
57
- These parameters affect the number and quality of lines detected, which in turn can impact the accuracy of the perspective correction.
58
- Adjusting these values allows fine-tuning the perspective correction process based on the specific characteristics of the input image.
59
- However, it is important to note that changing these values requires some experimentation to achieve the desired results, and it is recommended to find the optimal values through trial and error.
60
- """
61
-
62
- def manual_bg_intro():
63
- return """
64
- Click on the canvas and select four or more points, starting from any one corner of the slab and proceeding in order in any direction. The background will be removed using the selected points.
65
- """
66
-
67
- def segement_intro():
68
- return """
69
- Uses a custom trained model on multiple variations of the provided images. Accucary will increase if more images are provided and model is fine tuned.
70
- fine tuning the model for new images is a straight forward process, necessary documentaion and guidlines will be provided.
71
- Adjust the confidence score and IoU sliders to refine the selected area.
72
- """
 
2
  return """
3
  <h3 style='text-align: center;'>Introduction</h3>
4
 
5
+ <p>This app allows you to upload an image and test the detections aswell as download the configured executable script</p>
6
 
7
  <h4>Information:</h4>
8
  <ul>
9
  <li><b>Test Detection Algorithm:</b> In this demo you can easily test the accuracy of the detection algorithm by uploading photos with cars and humans </li>
10
+ <li><b>Customize and Download Script:</b> You can download the personlized executable script directly from here.</li>
11
  </ul>
12
  </div>
13
  """
 
16
  return """
17
  <div style='text-align: left;'>
18
  <h3 style='text-align: center;'>About this Demo</h3>
 
19
  <br>
20
  <h4>How to use:</h4>
21
  <ul>
22
  <li><b>Testing:</b> Simply upload any image with humans and cars, click apply and predict button</li>
23
+ <li><b>Downloading the Script:</b> You can set the destination folder, source folder and other settings to your choice via the GUI and click donwload button to download the finished executable python script.</li>
24
  </ul>
25
  <br>
26
  </div>
27
  """
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -14,7 +14,7 @@ opencv-python-headless>=4.1.2
14
  Pillow
15
  PyYAML>=5.3.1
16
  scipy>=1.4.1
17
- torch==1.7.1
18
  torchvision>=0.8.1
19
  tqdm>=4.41.0
20
  click==8
 
14
  Pillow
15
  PyYAML>=5.3.1
16
  scipy>=1.4.1
17
+ torch>=1.7.0
18
  torchvision>=0.8.1
19
  tqdm>=4.41.0
20
  click==8