Spaces:
Sleeping
Sleeping
Update doors_fasterrcnn.py
Browse files- doors_fasterrcnn.py +2 -2
doors_fasterrcnn.py
CHANGED
|
@@ -417,7 +417,7 @@ def add_annotations_to_pdf(image, pdf_name, lines, sanda, char_width, line_midpo
|
|
| 417 |
def main_run(img_pillow,pdf_fullpath, weights_path, pdf_name,pdfpath,ratio): ####pdf_fullpath here is the data and not the path
|
| 418 |
img_pillow = convert2pillow(pdf_fullpath)
|
| 419 |
|
| 420 |
-
num_classes =
|
| 421 |
|
| 422 |
# Load the model with the specified number of classes
|
| 423 |
model = get_model(num_classes)
|
|
@@ -438,7 +438,7 @@ def main_run(img_pillow,pdf_fullpath, weights_path, pdf_name,pdfpath,ratio): ###
|
|
| 438 |
model.to(device)
|
| 439 |
|
| 440 |
# START INFERENCE
|
| 441 |
-
doors_info = ev_model(img_pillow, model, device, 0.
|
| 442 |
#width_pixels, lines, sanda, line_midpoint, doubleD_bbox, doubleD_width = get_door_info(doors_info)
|
| 443 |
width_pixels, lines, sanda, line_midpoint, single_count, double_count, door_type = get_door_info(doors_info)
|
| 444 |
real_width = pxl2meter(width_pixels, ratio)
|
|
|
|
| 417 |
def main_run(img_pillow,pdf_fullpath, weights_path, pdf_name,pdfpath,ratio): ####pdf_fullpath here is the data and not the path
|
| 418 |
img_pillow = convert2pillow(pdf_fullpath)
|
| 419 |
|
| 420 |
+
num_classes = 12 # classes + background
|
| 421 |
|
| 422 |
# Load the model with the specified number of classes
|
| 423 |
model = get_model(num_classes)
|
|
|
|
| 438 |
model.to(device)
|
| 439 |
|
| 440 |
# START INFERENCE
|
| 441 |
+
doors_info = ev_model(img_pillow, model, device, 0.8)
|
| 442 |
#width_pixels, lines, sanda, line_midpoint, doubleD_bbox, doubleD_width = get_door_info(doors_info)
|
| 443 |
width_pixels, lines, sanda, line_midpoint, single_count, double_count, door_type = get_door_info(doors_info)
|
| 444 |
real_width = pxl2meter(width_pixels, ratio)
|