-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added url functionality to improc.read
- Loading branch information
Borg93
committed
Apr 10, 2024
1 parent
7f03d7c
commit c87b878
Showing
7 changed files
with
99 additions
and
47 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,16 +50,10 @@ def _create_segmentation_result(self, image: np.ndarray, output: UltralyticsResu | |
|
||
|
||
if __name__ == "__main__": | ||
import requests | ||
from PIL import Image | ||
|
||
from htrflow_core.utils.imgproc import pillow2opencv | ||
|
||
url = "https://github.com/Swedish-National-Archives-AI-lab/htrflow_core/blob/a1b4b31f9a8b7c658a26e0e665eb536a0d757c45/data/demo_image.jpg?raw=true" | ||
image = Image.open(requests.get(url, stream=True).raw).convert("RGB") | ||
|
||
model = YOLO(model="/home/[email protected]/repo/htrflow_core/.cache/yolov8n-seg.pt") | ||
|
||
results = model([pillow2opencv(image)]) | ||
results = model([url]) | ||
|
||
print(results[0].segments[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters