Upload folder using huggingface_hub
Browse files
6.2.0/annotatedimage/Index.svelte
CHANGED
|
@@ -6,6 +6,7 @@
|
|
| 6 |
IconButtonWrapper,
|
| 7 |
FullscreenButton
|
| 8 |
} from "@gradio/atoms";
|
|
|
|
| 9 |
import { Image } from "@gradio/icons";
|
| 10 |
import { StatusTracker } from "@gradio/statustracker";
|
| 11 |
import { Gradio } from "@gradio/utils";
|
|
@@ -70,8 +71,13 @@
|
|
| 70 |
<Empty size="large" unpadded_box={true}><Image /></Empty>
|
| 71 |
{:else}
|
| 72 |
<div class="image-container" bind:this={image_container}>
|
| 73 |
-
<IconButtonWrapper
|
| 74 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
<FullscreenButton
|
| 76 |
{fullscreen}
|
| 77 |
on:fullscreen={({ detail }) => {
|
|
|
|
| 6 |
IconButtonWrapper,
|
| 7 |
FullscreenButton
|
| 8 |
} from "@gradio/atoms";
|
| 9 |
+
import type { CustomButton as CustomButtonType } from "@gradio/utils";
|
| 10 |
import { Image } from "@gradio/icons";
|
| 11 |
import { StatusTracker } from "@gradio/statustracker";
|
| 12 |
import { Gradio } from "@gradio/utils";
|
|
|
|
| 71 |
<Empty size="large" unpadded_box={true}><Image /></Empty>
|
| 72 |
{:else}
|
| 73 |
<div class="image-container" bind:this={image_container}>
|
| 74 |
+
<IconButtonWrapper
|
| 75 |
+
buttons={gradio.props.buttons || []}
|
| 76 |
+
on_custom_button_click={(id) => {
|
| 77 |
+
gradio.dispatch("custom_button_click", { id });
|
| 78 |
+
}}
|
| 79 |
+
>
|
| 80 |
+
{#if (gradio.props.buttons || []).some((btn) => typeof btn === "string" && btn === "fullscreen")}
|
| 81 |
<FullscreenButton
|
| 82 |
{fullscreen}
|
| 83 |
on:fullscreen={({ detail }) => {
|
6.2.0/annotatedimage/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/annotatedimage",
|
| 3 |
-
"version": "0.
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/annotatedimage",
|
| 3 |
+
"version": "0.11.0",
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
6.2.0/annotatedimage/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import type { FileData } from "@gradio/client";
|
|
|
|
| 2 |
|
| 3 |
export interface Annotation {
|
| 4 |
image: FileData;
|
|
@@ -16,10 +17,11 @@ export interface AnnotatedImageProps {
|
|
| 16 |
height: number | undefined;
|
| 17 |
width: number | undefined;
|
| 18 |
color_map: Record<string, string>;
|
| 19 |
-
buttons: string[];
|
| 20 |
}
|
| 21 |
|
| 22 |
export interface AnnotatedImageEvents {
|
| 23 |
change: never;
|
| 24 |
select: { index: number; value: string };
|
|
|
|
| 25 |
}
|
|
|
|
| 1 |
import type { FileData } from "@gradio/client";
|
| 2 |
+
import type { CustomButton } from "@gradio/utils";
|
| 3 |
|
| 4 |
export interface Annotation {
|
| 5 |
image: FileData;
|
|
|
|
| 17 |
height: number | undefined;
|
| 18 |
width: number | undefined;
|
| 19 |
color_map: Record<string, string>;
|
| 20 |
+
buttons: (string | CustomButton)[];
|
| 21 |
}
|
| 22 |
|
| 23 |
export interface AnnotatedImageEvents {
|
| 24 |
change: never;
|
| 25 |
select: { index: number; value: string };
|
| 26 |
+
custom_button_click: { id: number };
|
| 27 |
}
|