Spaces:
Sleeping
Sleeping
Update classifier.py
Browse files- classifier.py +6 -2
classifier.py
CHANGED
|
@@ -24,8 +24,12 @@ def my_function(uploaded_file):
|
|
| 24 |
|
| 25 |
|
| 26 |
def detect_plate(img, text=''): # the function detects and perfors blurring on the number plate.
|
| 27 |
-
plate_img = img.copy()
|
| 28 |
-
roi = img.copy()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
plate_rect = plate_cascade.detectMultiScale(plate_img, scaleFactor = 1.2, minNeighbors = 7) # detects numberplates and returns the coordinates and dimensions of detected license plate's contours.
|
| 30 |
for (x,y,w,h) in plate_rect:
|
| 31 |
roi_ = roi[y:y+h, x:x+w, :] # extracting the Region of Interest of license plate for blurring.
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
def detect_plate(img, text=''): # the function detects and perfors blurring on the number plate.
|
| 27 |
+
#plate_img = img.copy()
|
| 28 |
+
#roi = img.copy()
|
| 29 |
+
plate_img = Image.open(img)
|
| 30 |
+
roi = Image.open(img)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
plate_rect = plate_cascade.detectMultiScale(plate_img, scaleFactor = 1.2, minNeighbors = 7) # detects numberplates and returns the coordinates and dimensions of detected license plate's contours.
|
| 34 |
for (x,y,w,h) in plate_rect:
|
| 35 |
roi_ = roi[y:y+h, x:x+w, :] # extracting the Region of Interest of license plate for blurring.
|