-
Notifications
You must be signed in to change notification settings - Fork 141
Develop DatumaroBinaryFormat to export/import the dataset header & DatasetItem #828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vinnamkim
merged 18 commits into
open-edge-platform:develop
from
vinnamkim:feature/add-datumaro-binary-format-dataset-item
Mar 1, 2023
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7b059e7
Initial copy from datumaro to datumaro_binary
vinnamkim 2b7aa7d
Some refactoring for Datumaro format
vinnamkim 2830be9
Refactor Datumaro format tests
vinnamkim c4b1abc
Merge remote-tracking branch 'upstream/develop' into refactor/datumar…
vinnamkim 9e3d1f3
Update CHANGELOG.md
vinnamkim 183a3f2
Fix CHANGELOG.md
vinnamkim 7317320
Add missing file
vinnamkim 28b3668
Merge remote-tracking branch 'upstream/develop' into refactor/datumar…
vinnamkim c2aaab9
Add CommonSemanticSegmentationWithSubsetDirsImporter
vinnamkim 1306b98
Add CommonSemanticSegmentationWithSubsetDirsImporter
vinnamkim 32a7530
Add Datumaro binary format (only header part)
vinnamkim ad2e96a
Add Mappers
vinnamkim 4031792
Merge remote-tracking branch 'upstream/develop' into feature/add-datu…
vinnamkim 06ed90b
Fix wrong merge
vinnamkim 061d354
Fix wrong merge again
vinnamkim 454b22c
Quick fix for CI failure because of dill
vinnamkim c2fcd38
Remove unused line
vinnamkim 7fcd938
Remove unused var
vinnamkim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright (C) 2023 Intel Corporation | ||
wonjuleee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
from typing import Optional | ||
|
||
from cryptography.fernet import Fernet | ||
|
||
|
||
class Crypter: | ||
FERNET_KEY_LEN = 44 | ||
|
||
def __init__(self, key: Optional[bytes]) -> None: | ||
if key is not None: | ||
self._key = key | ||
self._fernet = Fernet(self._key) | ||
else: | ||
self._key = None | ||
self._fernet = None | ||
|
||
@property | ||
def key(self) -> Optional[bytes]: | ||
return self._key | ||
|
||
def decrypt(self, msg: bytes): | ||
return self._fernet.decrypt(msg) if self._fernet is not None else msg | ||
|
||
def encrypt(self, msg: bytes): | ||
return self._fernet.encrypt(msg) if self._fernet is not None else msg | ||
|
||
def handshake(self, key: bytes) -> bool: | ||
if self._key is None and key == b"": | ||
return True | ||
if self._key is not None and self._key == key: | ||
return True | ||
|
||
return False | ||
|
||
@staticmethod | ||
def gen_key() -> bytes: | ||
return Fernet.generate_key() |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.