Skip to content

Commit

Permalink
feat(dataset_caption): support caption display
Browse files Browse the repository at this point in the history
  • Loading branch information
xifanii committed Sep 25, 2023
1 parent 6b69a3d commit 13a942d
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 74 deletions.
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

0 comments on commit 13a942d

Please sign in to comment.