Skip to content

Commit

Permalink
chore: url of streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziad-Muhammed committed Oct 3, 2022
1 parent 908286e commit ddff772
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 9 additions & 1 deletion LabellingApp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import glob
import sys
import time

Expand Down Expand Up @@ -116,7 +117,14 @@ def finish(self):
self.main_img.setText("Enter a new input directory\nAccuracy : {:.2f} %".format((self.incorrect_count / self.image_count)*100))
self.image_count=0
self.incorrect_count=0

self.clean_directory("./green_boxes")
self.clean_directory("./detections")
self.clean_directory("./outputs")
self.clean_directory("./localisation/data/images")
def clean_directory(self, path):
files = glob.glob(f'{path}/*')
for file in files:
os.remove(file)
def clean(self):
for label, text in zip(self.segmented_chars, self.combo_values):
# text.disconnect()
Expand Down
2 changes: 1 addition & 1 deletion localisation/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def detect_and_crop(image_path, saved_model_loaded, detect_multiple):
for bbox in bboxes:
if bbox[0] != 0 and bbox[1] != 0 and bbox[2] != 0 and bbox[3] != 0:
cv2.rectangle(original_image_clrs, (int(bbox[0]), int(bbox[1])), (int(bbox[2]), int(bbox[3])), (0, 255, 0),
25)
12)

img_path = "./green_boxes"
try:
Expand Down
7 changes: 4 additions & 3 deletions streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# from detect import crop_one
sys.path.insert(0, './localisation')
path = './localisation/data/images/1.png'
url = "http://192.168.20.51:8080/video"
# url = "http://192.168.20.51:8080/video"
url = "http://9.246.91.33:8080/video"
from localisation import detect
from segmentation.segmentation import segmentCharacters
from recognition.KNN import predictChars, classify_image_arrays
Expand Down Expand Up @@ -210,8 +211,8 @@ def __init__(self):

def run(self):
# capture from web-camera
capture = cv.VideoCapture(0)
# capture = cv.VideoCapture(url)
# capture = cv.VideoCapture(0)
capture = cv.VideoCapture(url)
while self._run_flag:
global frame
ret, frame = capture.read()
Expand Down

0 comments on commit ddff772

Please sign in to comment.