Skip to content

Commit 855e4bc

Browse files
committed
Fix issue with video window
1 parent c7f8abf commit 855e4bc

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Abraia Python SDK image analysis toolbox
66

7-
The Abraia Python SDK provides and easy and practical way to develop and deploy Machine Learning image applications on the edge. You can easily annotate and train your custom deep learning model with [DeepLab](https://abraia.me/deeplab), and deploy the model with this Python SDK.
7+
The Abraia Python SDK provides and easy and practical way to develop and deploy Machine Learning image applications on the edge. You can easily annotate and train your custom deep learning model with [DeepLab](https://abraia.me/deeplab/), and deploy the model with this Python SDK.
88

99
![people walking](https://github.com/abraia/abraia-multiple/raw/master/images/people-walking.gif)
1010

@@ -39,9 +39,7 @@ You can easily train your custom models from [DeepLab](https://abraia.me/deeplab
3939
```python
4040
from abraia import detect
4141

42-
dataset = 'camera'
43-
model_name = 'yolov8n'
44-
model_uri = f"https://api.abraia.me/files/multiple/{dataset}/{model_name}.onnx"
42+
model_uri = f"https://api.abraia.me/files/multiple/camera/yolov8n.onnx"
4543

4644
model = detect.load_model(model_uri)
4745

@@ -61,15 +59,13 @@ from PIL import Image
6159
from abraia import detect
6260

6361

64-
dataset = 'camera'
65-
model_name = 'yolov8n'
66-
model_uri = f"https://api.abraia.me/files/multiple/{dataset}/{model_name}.onnx"
62+
model_uri = f"https://api.abraia.me/files/multiple/camera/yolov8n.onnx"
6763

6864
model = detect.load_model(model_uri)
6965

7066
video = detect.Video('people-walking.mp4')
7167
for frame in video:
72-
img = Image.fromarray(frame)
68+
im = Image.fromarray(frame)
7369
results = model.run(im, confidence=0.5, iou_threshold=0.5)
7470
im = detect.render_results(im, results)
7571
frame = np.array(im)
@@ -213,7 +209,7 @@ multiple.save_image('test.hdr', img, metadata=meta)
213209

214210
### Upload and load HSI data
215211

216-
To start with, we may [upload some data](https://abraia.me/console/gallery) directly using the graphical interface, or using the multiple api:
212+
To start with, we may [upload some data](https://abraia.me/deeplab/) directly using the graphical interface, or using the multiple api:
217213

218214
```python
219215
multiple.upload_file('PaviaU.mat')

abraia/detect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from PIL import Image, ImageDraw, ImageFont
1111

12-
from video import Video
12+
from .video import Video
1313

1414

1515
tempdir = tempfile.gettempdir()

abraia/video.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self, src, output=None):
1313
print(self.width, self.height, self.fps)
1414
if output:
1515
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
16-
self.out = cv2.VideoWriter('output.mp4', fourcc, self.fps, (self.width, self.height))
16+
self.out = cv2.VideoWriter(output, fourcc, self.fps, (self.width, self.height))
1717

1818
def __iter__(self):
1919
while self.cap.isOpened():
@@ -26,6 +26,7 @@ def __iter__(self):
2626
self.out.release()
2727
if self.win_name:
2828
cv2.destroyWindow(self.win_name)
29+
cv2.waitKey(1)
2930

3031
def write(self, frame):
3132
self.out.write(cv2.cvtColor(frame, cv2.COLOR_RGB2BGR))

scripts/abraia

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def input_files(src):
4242

4343

4444
@click.group('abraia')
45-
@click.version_option('0.15.1')
45+
@click.version_option('0.15.2')
4646
def cli():
4747
"""Abraia CLI tool"""
4848
pass
@@ -64,7 +64,7 @@ def configure():
6464
@cli.command()
6565
def info():
6666
"""Show user account information"""
67-
click.echo('abraia, version 0.15.1\n')
67+
click.echo('abraia, version 0.15.2\n')
6868
click.echo('Go to [' + click.style('https://abraia.me/console/', fg='green') + '] to see your account information\n')
6969

7070

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name='abraia',
15-
version='0.15.1',
15+
version='0.15.2',
1616
description='Abraia Python SDK',
1717
long_description=long_description,
1818
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)