Skip to content

Commit 7cb9528

Browse files
authored
add InferenceCore to matanyone code snippet (#1510)
minor improvement to the matanyone code snippet following pq-yang/MatAnyone#35 adding the second method for loading the model using the `InferenceCore` a class that automatically loads the model and easily processes videos. this snippet is intended to be used as follows : ```python from matanyone.inference.inference_core import InferenceCore processor = InferenceCore("PeiqingYang/MatAnyone") # foreground_path, alpha_path = processor.process_video( # input_path = "inputs/video/test-sample1.mp4", # mask_path = "inputs/mask/test-sample1.png", # output_path = "outputs" # ) ```
1 parent 474e4ef commit 7cb9528

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,9 @@ export const matanyone = (model: ModelData): string[] => [
731731
732732
from matanyone.model.matanyone import MatAnyone
733733
model = MatAnyone.from_pretrained("${model.id}")`,
734+
`
735+
from matanyone import InferenceCore
736+
processor = InferenceCore("${model.id}")`,
734737
];
735738

736739
export const mesh_anything = (): string[] => [

0 commit comments

Comments
 (0)