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

Release v1.0.2 cherry picks #4991

Open
wants to merge 40 commits into
base: release/v1.0.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6884c87
fix model zoo docs build
brimoor Oct 24, 2024
ab27a4e
Fix documentation error
orvisevans Oct 22, 2024
3c68905
documenting ctx.user
brimoor Oct 17, 2024
8a37106
adding user_request_token
brimoor Oct 17, 2024
0048f7b
removing Teams-only tag
brimoor Oct 17, 2024
842efa8
must use instance variable
brimoor Oct 17, 2024
6c0b581
set model to eval model
jacobmarks Oct 17, 2024
44c04b8
document open_clip eval() mode
jacobmarks Oct 17, 2024
e8be6b6
update amp autocast
jacobmarks Oct 17, 2024
69d4a7e
update HF dataset repo ids
jacobmarks Oct 17, 2024
e009587
add depth anything models to integration docs
jacobmarks Oct 17, 2024
5e4f01b
clarifying model vs source metadata for remote zoo models
brimoor Oct 16, 2024
dd3c8de
rm unused import
jacobmarks Oct 5, 2024
7b15892
fix yolonas tag
jacobmarks Oct 5, 2024
1ca5e93
add yolov11 det models to zoo
jacobmarks Oct 5, 2024
6c5387f
update syntax to match ultralytics
jacobmarks Oct 5, 2024
eef88ac
add yolo11 det models to docs
jacobmarks Oct 5, 2024
6757a66
add yolo11seg models to manifest
jacobmarks Oct 5, 2024
832af1a
add yolo11seg models to manifest
jacobmarks Oct 5, 2024
d073a1e
add yolo11seg models to docs
jacobmarks Oct 5, 2024
144f43d
fix model zoo docs build
brimoor Oct 24, 2024
b6a5344
Adding SAM2.1 checkpoints
prernadh Oct 24, 2024
6a6a759
use 2.1
brimoor Oct 24, 2024
6681ad9
fixing links
brimoor Oct 24, 2024
1eaf784
fix overlay z-indax for panel menus
ritch Oct 21, 2024
2f1cd84
fix bug where timeline name wasn't being forwarded in seek utils (#4975)
sashankaryal Oct 24, 2024
b38cc7d
fix panel overflow
ritch Oct 22, 2024
df48877
add label_count link
ritch Oct 24, 2024
7c803ed
add timeline view
ritch Oct 22, 2024
19c4e01
timeline view polish
ritch Oct 23, 2024
5e611c1
timeline view validation
ritch Oct 23, 2024
28ab8a3
remove timline loading indicator
ritch Oct 23, 2024
e9f6643
Update app/packages/core/src/plugins/SchemaIO/components/FrameLoaderV…
ritch Oct 23, 2024
2c3b284
Update app/packages/core/src/plugins/SchemaIO/components/TimelineView…
ritch Oct 23, 2024
e61c145
pr comments timelineview
ritch Oct 23, 2024
6daea1e
fix imports
ritch Oct 25, 2024
586159b
release notes
brimoor Oct 25, 2024
389557c
remove unused imports
ritch Oct 25, 2024
3d92aab
fix: quickstart3d load due to dict changed size during iteration
swheaton Oct 26, 2024
54d0912
updating release notes
brimoor Oct 30, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
overlayToSx,
} from "../utils";
import { ViewPropsType } from "../utils/types";
import { has } from "lodash";
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove unused lodash import

The has function from lodash is imported but never used in the code. This unnecessary import should be removed to maintain a clean codebase and optimize bundle size.

-import { has } from "lodash";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { has } from "lodash";


export default function ContainerizedComponent(props: ContainerizedComponent) {
const { schema, children } = props;
Expand All @@ -22,7 +23,11 @@ export default function ContainerizedComponent(props: ContainerizedComponent) {
}

if (isCompositeView(schema)) {
const hasOverlay = !!schema?.view?.overlay;
const sxForOverlay = overlayToSx[schema?.view?.overlay] || {};
if (hasOverlay) {
sxForOverlay.zIndex = 999;
}
Comment on lines +28 to +30
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider using a named constant for z-index value

The hardcoded z-index value of 999 should be defined as a named constant at the module level for better maintainability and to prevent potential layering conflicts.

+const OVERLAY_Z_INDEX = 999;

// Later in the code
 if (hasOverlay) {
-  sxForOverlay.zIndex = 999;
+  sxForOverlay.zIndex = OVERLAY_Z_INDEX;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (hasOverlay) {
sxForOverlay.zIndex = 999;
}
const OVERLAY_Z_INDEX = 999;
if (hasOverlay) {
sxForOverlay.zIndex = OVERLAY_Z_INDEX;
}

return (
<Box sx={{ position: "relative", ...sxForOverlay }}>
{containerizedChildren}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { usePanelId, useSetPanelStateById } from "@fiftyone/spaces";
import { useTimeline } from "@fiftyone/playback/src/lib/use-timeline";
import _ from "lodash";

const FRAME_LOADED_EVENT = "frames-loaded";

export default function FrameLoaderView(props: ViewPropsType) {
const { schema, path, data } = props;
const { view = {} } = schema;
Expand All @@ -19,15 +21,16 @@ export default function FrameLoaderView(props: ViewPropsType) {
const setPanelState = useSetPanelStateById(true);
const localIdRef = React.useRef<string>();
const bufm = useRef(new BufferManager());
const frameDataRef = useRef<typeof data.frames>(null);

useEffect(() => {
localIdRef.current = Math.random().toString(36).substring(7);
if (data?.frames)
window.dispatchEvent(
new CustomEvent(`frames-loaded`, {
detail: { localId: localIdRef.current },
})
);
if (data?.frames) frameDataRef.current = data.frames;
window.dispatchEvent(
new CustomEvent(FRAME_LOADED_EVENT, {
detail: { localId: localIdRef.current },
})
);
Comment on lines +28 to +33
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider conditional event dispatch

The event is currently dispatched regardless of whether frames data changed. Consider dispatching only when frames data is updated to avoid unnecessary events.

  useEffect(() => {
    localIdRef.current = Math.random().toString(36).substring(7);
-    if (data?.frames) frameDataRef.current = data.frames;
-    window.dispatchEvent(
-      new CustomEvent(FRAME_LOADED_EVENT, {
-        detail: { localId: localIdRef.current },
-      })
-    );
+    if (data?.frames) {
+      frameDataRef.current = data.frames;
+      window.dispatchEvent(
+        new CustomEvent(FRAME_LOADED_EVENT, {
+          detail: { localId: localIdRef.current },
+        })
+      );
+    }
  }, [data?.signature]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (data?.frames) frameDataRef.current = data.frames;
window.dispatchEvent(
new CustomEvent(FRAME_LOADED_EVENT, {
detail: { localId: localIdRef.current },
})
);
useEffect(() => {
localIdRef.current = Math.random().toString(36).substring(7);
if (data?.frames) {
frameDataRef.current = data.frames;
window.dispatchEvent(
new CustomEvent(FRAME_LOADED_EVENT, {
detail: { localId: localIdRef.current },
})
);
}
}, [data?.signature]);

}, [data?.signature]);

const loadRange = React.useCallback(
Expand All @@ -44,15 +47,22 @@ export default function FrameLoaderView(props: ViewPropsType) {
}

return new Promise<void>((resolve) => {
window.addEventListener(`frames-loaded`, (e) => {
if (
e instanceof CustomEvent &&
e.detail.localId === localIdRef.current
) {
bufm.current.addNewRange(range);
resolve();
}
});
if (frameDataRef.current) {
bufm.current.addNewRange(range);
resolve();
} else {
const onFramesLoaded = (e) => {
if (
e instanceof CustomEvent &&
e.detail.localId === localIdRef.current
) {
window.removeEventListener(FRAME_LOADED_EVENT, onFramesLoaded);
bufm.current.addNewRange(range);
resolve();
}
};
window.addEventListener(FRAME_LOADED_EVENT, onFramesLoaded);
}
Comment on lines +50 to +65
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Improve type safety and cleanup handling

The event handling logic looks good but could benefit from improved type safety and cleanup handling.

  1. Add proper type checking for CustomEvent
  2. Add cleanup for pending event listeners on component unmount
+type FrameLoadedEvent = CustomEvent<{ localId: string }>;

+const isFrameLoadedEvent = (e: Event): e is FrameLoadedEvent => {
+  return e instanceof CustomEvent && 'localId' in e.detail;
+};

 const loadRange = React.useCallback(
   async (range: BufferRange) => {
     if (on_load_range) {
       const unp = bufm.current.getUnprocessedBufferRange(range);
       const isProcessed = unp === null;

       if (!isProcessed) {
         await triggerEvent(panelId, {
           params: { range: unp },
           operator: on_load_range,
         });
       }

       return new Promise<void>((resolve) => {
         if (frameDataRef.current) {
           bufm.current.addNewRange(range);
           resolve();
         } else {
-            const onFramesLoaded = (e) => {
-              if (
-                e instanceof CustomEvent &&
-                e.detail.localId === localIdRef.current
-              ) {
+            const onFramesLoaded = (e: Event) => {
+              if (isFrameLoadedEvent(e) && e.detail.localId === localIdRef.current) {
                 window.removeEventListener(FRAME_LOADED_EVENT, onFramesLoaded);
                 bufm.current.addNewRange(range);
                 resolve();
               }
             };
             window.addEventListener(FRAME_LOADED_EVENT, onFramesLoaded);
         }
       });
     }
   },
   [triggerEvent, on_load_range, localIdRef.current]
 );

Also, add cleanup in a useEffect:

useEffect(() => {
  return () => {
    // Cleanup any pending event listeners on unmount
    const cleanup = (e: Event) => {
      if (isFrameLoadedEvent(e) && e.detail.localId === localIdRef.current) {
        window.removeEventListener(FRAME_LOADED_EVENT, cleanup);
      }
    };
    window.addEventListener(FRAME_LOADED_EVENT, cleanup);
  };
}, []);

});
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ export default function PlotlyView(props: ViewPropsType) {
return (
<Box
{...getComponentProps(props, "container")}
useResizeHandler
sx={{ height: "100%", width: "100%" }}
>
<HeaderView {...props} nested />
Expand Down
43 changes: 43 additions & 0 deletions app/packages/core/src/plugins/SchemaIO/components/TimelineView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { useMemo } from "react";
import { Timeline, useCreateTimeline, useTimeline } from "@fiftyone/playback";
import { ViewPropsType } from "../utils/types";

const DEFAULT_CONFIG = { loop: false };

export default function TimelineView(props: ViewPropsType) {
const { schema } = props;
const { view = {} } = schema;
const { timeline_name, loop, total_frames } = view;
Comment on lines +7 to +10
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve props type safety with specific destructuring

The view object's shape should be explicitly typed for better type safety:

+type TimelineViewData = {
+  timeline_name?: string;
+  loop?: boolean;
+  total_frames?: number;
+};

export default function TimelineView(props: ViewPropsType) {
  const { schema } = props;
-  const { view = {} } = schema;
+  const { view = {} as TimelineViewData } = schema;
  const { timeline_name, loop, total_frames } = view;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default function TimelineView(props: ViewPropsType) {
const { schema } = props;
const { view = {} } = schema;
const { timeline_name, loop, total_frames } = view;
type TimelineViewData = {
timeline_name?: string;
loop?: boolean;
total_frames?: number;
};
export default function TimelineView(props: ViewPropsType) {
const { schema } = props;
const { view = {} as TimelineViewData } = schema;
const { timeline_name, loop, total_frames } = view;


const providedConfig = {
loop,
totalFrames: total_frames,
};

const finalConfig = useMemo(
() => ({ ...DEFAULT_CONFIG, ...providedConfig }),
[providedConfig]
);
if (!timeline_name) {
throw new Error("Timeline name is required");
}
if (!finalConfig.totalFrames) {
throw new Error("Total frames is required");
}
Comment on lines +21 to +26
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance error handling with descriptive messages

The error messages should be more descriptive and include available context. Also, consider wrapping the component in an error boundary.

-    throw new Error("Timeline name is required");
+    throw new Error("TimelineView: timeline_name is required in the view configuration");

-    throw new Error("Total frames is required");
+    throw new Error(`TimelineView: totalFrames is required in the configuration for timeline "${timeline_name}"`);

Consider implementing an error boundary:

class TimelineErrorBoundary extends React.Component<{ children: React.ReactNode }> {
  componentDidCatch(error: Error) {
    console.error("Timeline failed to render:", error);
    // Add your error reporting logic here
  }

  render() {
    return this.props.children;
  }
}


return <TimelineCreator timelineName={timeline_name} {...finalConfig} />;
}

export const TimelineCreator = ({ timelineName, totalFrames, loop }) => {
const config = useMemo(() => ({ totalFrames, loop }), [totalFrames, loop]);
const { isTimelineInitialized } = useCreateTimeline({
name: timelineName,
config,
});

if (!isTimelineInitialized) {
return null;
}

return <Timeline name={timelineName} />;
};
Comment on lines +31 to +43
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add prop types and improve error handling for TimelineCreator

The component needs proper TypeScript types and better error/loading state handling:

-export const TimelineCreator = ({ timelineName, totalFrames, loop }) => {
+type TimelineCreatorProps = {
+  timelineName: string;
+  totalFrames: number;
+  loop: boolean;
+};

+export const TimelineCreator: React.FC<TimelineCreatorProps> = ({
+  timelineName,
+  totalFrames,
+  loop,
+}) => {
  const config = useMemo(() => ({ totalFrames, loop }), [totalFrames, loop]);
-  const { isTimelineInitialized } = useCreateTimeline({
+  const { isTimelineInitialized, error } = useCreateTimeline({
    name: timelineName,
    config,
  });

+  if (error) {
+    throw new Error(`Failed to initialize timeline: ${error.message}`);
+  }

  if (!isTimelineInitialized) {
-    return null;
+    return <div>Initializing timeline...</div>;
  }

  return <Timeline name={timelineName} />;
};
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const TimelineCreator = ({ timelineName, totalFrames, loop }) => {
const config = useMemo(() => ({ totalFrames, loop }), [totalFrames, loop]);
const { isTimelineInitialized } = useCreateTimeline({
name: timelineName,
config,
});
if (!isTimelineInitialized) {
return null;
}
return <Timeline name={timelineName} />;
};
type TimelineCreatorProps = {
timelineName: string;
totalFrames: number;
loop: boolean;
};
export const TimelineCreator: React.FC<TimelineCreatorProps> = ({
timelineName,
totalFrames,
loop,
}) => {
const config = useMemo(() => ({ totalFrames, loop }), [totalFrames, loop]);
const { isTimelineInitialized, error } = useCreateTimeline({
name: timelineName,
config,
});
if (error) {
throw new Error(`Failed to initialize timeline: ${error.message}`);
}
if (!isTimelineInitialized) {
return <div>Initializing timeline...</div>;
}
return <Timeline name={timelineName} />;
};

2 changes: 1 addition & 1 deletion app/packages/core/src/plugins/SchemaIO/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ export { default as TableView } from "./TableView";
export { default as TabsView } from "./TabsView";
export { default as TagsView } from "./TagsView";
export { default as TextFieldView } from "./TextFieldView";
export { default as TimelineView } from "./TimelineView";
export { default as TupleView } from "./TupleView";
export { default as UnsupportedView } from "./UnsupportedView";
export { default as FrameLoaderView } from "./FrameLoaderView";
11 changes: 9 additions & 2 deletions app/packages/playback/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { fixupConfigRules } from "@eslint/compat";
import hooksPlugin from "eslint-plugin-react-hooks";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import globals from "globals";
import tseslint from "typescript-eslint";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import { fixupConfigRules } from "@eslint/compat";

export default [
{ files: ["lib/**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{ languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } },
{ languageOptions: { globals: globals.browser } },
...tseslint.configs.recommended,
...fixupConfigRules(pluginReactConfig),
{
plugins: {
"react-hooks": hooksPlugin,
},
rules: hooksPlugin.configs.recommended.rules,
},
];
1 change: 1 addition & 0 deletions app/packages/playback/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"@eslint/compat": "^1.1.1",
"eslint": "9.7.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "rc",
"globals": "^15.8.0",
"prettier": "^3.3.3",
"typescript": "^5.5.4",
Expand Down
12 changes: 7 additions & 5 deletions app/packages/playback/src/views/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ interface TimelineProps {
*/
export const Timeline = React.memo(
React.forwardRef<HTMLDivElement, TimelineProps>(
({ name, style, controlsStyle }, ref) => {
(timelineProps: TimelineProps, ref) => {
const { name, style, controlsStyle } = timelineProps;

const { playHeadState, config, play, pause, setSpeed } =
useTimeline(name);
const frameNumber = useFrameNumber(name);

const { getSeekValue, seekTo } = useTimelineVizUtils();
const { getSeekValue, seekTo } = useTimelineVizUtils(name);

const seekBarValue = React.useMemo(() => getSeekValue(), [frameNumber]);
const seekBarValue = React.useMemo(() => getSeekValue(), [getSeekValue]);
Comment on lines +36 to +38
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Memoization dependencies are incomplete

The seekBarValue memoization only depends on getSeekValue, but getSeekValue itself depends on frameNumber and config.totalFrames. Since these dependencies can change independently of the getSeekValue function reference, they should be included in the useMemo dependency array:

const seekBarValue = React.useMemo(() => getSeekValue(), [getSeekValue, frameNumber, config.totalFrames]);
🔗 Analysis chain

Verify seekBarValue memoization dependencies

The memoization depends only on getSeekValue, but consider if there are other dependencies that could affect the seek value calculation.


Let me gather more information about the implementation of useTimelineVizUtils to understand the dependencies.


Let me check the complete implementation of getSeekValue and its dependencies in useTimelineVizUtils.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for references to getSeekValue to understand its dependencies
ast-grep --pattern 'const { $$$, getSeekValue, $$$ } = useTimelineVizUtils($$$)'

Length of output: 196


Script:

#!/bin/bash
# Search for useTimelineVizUtils implementation
ast-grep --pattern 'function useTimelineVizUtils($_) {
  $$$
}'

# Also search for any file containing useTimelineVizUtils
rg "useTimelineVizUtils" -A 10

Length of output: 2753


Script:

#!/bin/bash
# Get the complete implementation of useTimelineVizUtils
rg -A 30 "export const useTimelineVizUtils = \(name\?: TimelineName\)" app/packages/playback/src/lib/use-timeline-viz-utils.ts

Length of output: 1019


const { loaded, loading } = useTimelineBuffers(name);

Expand All @@ -52,15 +54,15 @@ export const Timeline = React.memo(
detail: { timelineName: name, start: true },
})
);
}, [pause]);
}, [pause, name]);
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider improving event handling type safety

While the event handling works correctly, consider these improvements for better maintainability:

+// At the top of the file
+interface SeekEventDetail {
+  timelineName: TimelineName;
+  start: boolean;
+}
+
+const SEEK_EVENT = 'seek';
+
 const onSeekStart = React.useCallback(() => {
   pause();
   dispatchEvent(
-    new CustomEvent("seek", {
+    new CustomEvent<SeekEventDetail>(SEEK_EVENT, {
       detail: { timelineName: name, start: true },
     })
   );
 }, [pause, name]);

Also applies to: 65-65


const onSeekEnd = React.useCallback(() => {
dispatchEvent(
new CustomEvent("seek", {
detail: { timelineName: name, start: false },
})
);
}, []);
}, [name]);

const [isHoveringSeekBar, setIsHoveringSeekBar] = React.useState(false);

Expand Down
10 changes: 10 additions & 0 deletions app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,7 @@ __metadata:
"@eslint/compat": ^1.1.1
eslint: 9.7.0
eslint-plugin-react: ^7.35.0
eslint-plugin-react-hooks: rc
globals: ^15.8.0
jotai: ^2.9.3
jotai-optics: ^0.4.0
Expand Down Expand Up @@ -8372,6 +8373,15 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-react-hooks@npm:rc":
version: 5.1.0-rc-28668d39-20241023
resolution: "eslint-plugin-react-hooks@npm:5.1.0-rc-28668d39-20241023"
peerDependencies:
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0
checksum: 6ad29212fa76b96488a6eeb9941a9a6111420092cc309417f5569f917e4e40b15ed282172842ca8611466387c3d750ceee07e9e739e4c28e808065eaf9ed2307
languageName: node
linkType: hard

"eslint-plugin-react@npm:^7.31.11":
version: 7.34.1
resolution: "eslint-plugin-react@npm:7.34.1"
Expand Down
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/source/user_guide/model_zoo/models.rst
/source/model_zoo/models.rst
16 changes: 8 additions & 8 deletions docs/scripts/make_model_zoo_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,25 +147,25 @@
dataset.apply_model(model, label_field="auto")

session = fo.launch_app(dataset)
{% elif 'segment-anything' in tags and 'video' in tags and 'med-SAM' not in tags %}
{% elif 'med-sam' in name %}
model = foz.load_zoo_model("{{ name }}")

# Segment inside boxes and propagate to all frames
dataset.apply_model(
model,
label_field="segmentations",
prompt_field="frames.detections", # can contain Detections or Keypoints
label_field="pred_segmentations",
prompt_field="frames.gt_detections",
)

session = fo.launch_app(dataset)
{% elif 'med-sam' in name %}
{% elif 'segment-anything' in tags and 'video' in tags %}
model = foz.load_zoo_model("{{ name }}")

# Segment inside boxes and propagate to all frames
dataset.apply_model(
model,
label_field="pred_segmentations",
prompt_field="frames.gt_detections",
label_field="segmentations",
prompt_field="frames.detections", # can contain Detections or Keypoints
)

session = fo.launch_app(dataset)
Expand Down Expand Up @@ -354,7 +354,7 @@ def _render_card_model_content(template, model_name):

tags = ",".join(tags)

link = "models.html#%s" % zoo_model.name
link = "models.html#%s" % zoo_model.name.replace(".", "-")

description = zoo_model.description

Expand Down Expand Up @@ -423,7 +423,7 @@ def main():
# Write docs page

docs_dir = "/".join(os.path.realpath(__file__).split("/")[:-2])
outpath = os.path.join(docs_dir, "source/user_guide/model_zoo/models.rst")
outpath = os.path.join(docs_dir, "source/model_zoo/models.rst")

print("Writing '%s'" % outpath)
etau.write_file("\n".join(content), outpath)
Expand Down
Loading
Loading