Skip to content
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

補助情報の種類を「カスタム」ではなく適切な値にする #101

Merged
merged 4 commits into from
Jul 28, 2022

Conversation

pfe171
Copy link
Contributor

@pfe171 pfe171 commented Jul 19, 2022

解決されるissue
fix #93

目的
入力データの補助情報の種類はcustom・image・textの3種類があるが、現状では補助情報種類はすべてcustomで登録されるようになっている。
そのため、補助情報の種類を以下の通り設定したい。

  • カメラ画像: image
  • カメラ画像に対応するキャリブレーションファイル: text
  • メタ情報ファイル: text

そうすることにより、入力データ詳細画面でカメラ画像のプレビューが表示されるようになる。

実装
補助情報クラス(SupplementaryData)に補助情報の種類(data_type)を追加し、apiに渡すようにした。

実行コマンド
anno3d project upload_kitti_data --annofab_id ${ANNO_ID} --annofab_pass ${ANNO_PASS} --project_id PROJECT_ID --kitti-dir KITTI_DIR [--force]

以上のコマンドを実行後、annofab上で入力データの詳細を閲覧すると、プレビューが正しく表示される。

  • 実装前
    preview1

  • 実装後
    preview2

Copy link
Contributor

@seraphr seraphr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfe171
supplementary_data_typeのデフォルト引数を除去しました(ほとんど指定されていたし、デフォルト引数にしてもあまり嬉しくなかったので)。 fdf614a
それ以外は問題無さそう

@@ -32,6 +32,7 @@
class SupplementaryData:
data_id: str
path: Path
data_type: Literal["custom", "image", "text"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seraphr annofabapi.models.SupplementaryDataTypeというEnumクラスがありますが、これを利用した方がよいのでしょうか?
それとも、anno3d/simple_data_uploader.pyannofabapiに依存しない方が良いのでしょうか?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seraphr と話したこと

  • annofabapi.models.SupplementaryDataTypeを使うメリットはそこまでない
    • annofabapiのAPIを実行する関数で、annofabapi.models.SupplementaryDataType型の値を求めている訳ではな
    • メリットがあるとしたら、SupplementaryDataTypeの値が増えたときに、変更が不要なことぐらい

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すみません、annofabapi.models.SupplementaryDataTypeの存在を完全に見落としていました。

手元で実装を変えて試してみましたが、annofabapi.models.SupplementaryDataTypeを使用しても同じ機能は果たせました。
ですが、個人的にはannofabapi.models.SupplementaryDataTypeを使わない方がコードは見やすく、理解しやすい気がしました。
ただ、annofabapiのドキュメントにはSupplementaryDataTypeとはっきり記載がある点と、仰っていただいたようにSupplementaryDataTypeの値が増えたときのことを考えると、使う方が合理的ともいえると思います。(実際に増えることがあるのかはわかりませんが...)

使った方にしておきたいということでしたら、annofabapi.models.SupplementaryDataTypeを使ったバージョンをコミットしますが、いかがでしょうか?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使った方にしておきたいということでしたら、annofabapi.models.SupplementaryDataTypeを使ったバージョンをコミットしますが、いかがでしょうか?

いろいろ試していただき、ありがとうございます。
曖昧なコメントで申し訳ありません。
@seraphr と話した際、「annofabapi.models.SupplementaryDataTypeを使わない」という結果になったので、対応は不要です。

@seraphr seraphr merged commit 8dde682 into master Jul 28, 2022
@seraphr seraphr deleted the feature/93_supplementary-data branch July 28, 2022 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

補助情報の種類を「カスタム」ではなく適切な値にして欲しい
3 participants