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

feat(dataset_caption): support caption display #97

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deepdataspace/server/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
</head>
<body>
<div id="root"></div>
<script src="/static/umi.910c5012.js"></script>
<script src="/static/umi.d0ec6102.js"></script>

</body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deepdataspace/server/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
</head>
<body>
<div id="root"></div>
<script src="/static/umi.910c5012.js"></script>
<script src="/static/umi.d0ec6102.js"></script>

</body></html>
5 changes: 4 additions & 1 deletion packages/app/src/pages/Dataset/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ const Page: React.FC = () => {
/>
)}
{displayOptionsResult.showImgDesc && (
<div className={styles.label}> {item.desc} </div>
<div className={styles.label}>
{' '}
{item.caption || item.desc}{' '}
</div>
)}
{flagTools && item.selected ? (
<div className={styles.itemSelectedMask} />
Expand Down
5 changes: 4 additions & 1 deletion packages/app/src/pages/Lab/FlagTool/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ const Page: React.FC = () => {
/>
)}
{displayOptionsResult.showImgDesc && (
<div className={styles.label}> {item.desc} </div>
<div className={styles.label}>
{' '}
{item.caption || item.desc}{' '}
</div>
)}
{flagTools && item.selected ? (
<div className={styles.itemSelectedMask} />
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/types/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export namespace NsDataSet {

export interface DataSetImg extends BaseImage {
desc: string;
caption?: string;
metadata: Record<string, string>;
objects: Array<DatasetObject>;
/** 0/1/2 */
Expand Down
9 changes: 9 additions & 0 deletions packages/components/src/Annotator/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,15 @@ const Preview: React.FC<PreviewProps> = (props) => {
: metadata[key]}
</div>
))}
{
list[current]?.caption ? (
<div className="item">
{'caption'}
<br />
{list[current].caption}
</div>
) : null
}
</div>
<div className="bottom-mask" />
<div className="hide-info-btn" onClick={changeShowInfo}>
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/Annotator/tools/useSkeleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const renderKeypoints = (
for (let i = 0; i * 2 < lines.length; i++) {
const [index1, index2] = [lines[i * 2], lines[i * 2 + 1]];
if (
points[index1].visible === KEYPOINTS_VISIBLE_TYPE.labeledVisible &&
points[index2].visible === KEYPOINTS_VISIBLE_TYPE.labeledVisible
points[index1]?.visible === KEYPOINTS_VISIBLE_TYPE.labeledVisible &&
points[index2]?.visible === KEYPOINTS_VISIBLE_TYPE.labeledVisible
) {
drawLine(
canvas,
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/Annotator/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export interface DrawImageData {
urlFullRes: string;
objects: DrawObject[];
metadata?: Record<string, string>;
caption?: string;
}

export enum EObjectStatus {
Expand Down
Loading