@lumy-pack/scene-sieve 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +47 -24
  2. package/dist/{errors.d.ts → cli/errors/classify-error.d.ts} +5 -0
  3. package/dist/cli/index.d.ts +3 -0
  4. package/dist/{utils → cli/options}/parse-options.d.ts +6 -1
  5. package/dist/cli.mjs +755 -319
  6. package/dist/constants/pipeline-defaults.d.ts +13 -0
  7. package/dist/core/{analyzer.d.ts → analyzer/analyzer.d.ts} +11 -6
  8. package/dist/core/{dbscan.d.ts → analyzer/clustering/dbscan.d.ts} +1 -1
  9. package/dist/core/analyzer/constants/vision-tuning.d.ts +12 -0
  10. package/dist/core/analyzer/features/feature-diff.d.ts +14 -0
  11. package/dist/core/analyzer/features/frame-features.d.ts +32 -0
  12. package/dist/core/analyzer/index.d.ts +3 -0
  13. package/dist/core/constants/workspace-layout.d.ts +9 -0
  14. package/dist/core/{extractor.d.ts → extractor/extractor.d.ts} +6 -4
  15. package/dist/core/extractor/index.d.ts +1 -0
  16. package/dist/core/index.d.ts +8 -9
  17. package/dist/core/input-resolver/index.d.ts +1 -0
  18. package/dist/core/{input-resolver.d.ts → input-resolver/input-resolver.d.ts} +11 -1
  19. package/dist/core/input-resolver/validation/validate-options.d.ts +8 -0
  20. package/dist/core/orchestrator/index.d.ts +3 -0
  21. package/dist/core/{orchestrator.d.ts → orchestrator/orchestrator.d.ts} +1 -1
  22. package/dist/core/{run-in-worker.d.ts → orchestrator/worker/run-in-worker.d.ts} +5 -1
  23. package/dist/core/pruner/index.d.ts +1 -0
  24. package/dist/core/{pruner.d.ts → pruner/pruner.d.ts} +2 -2
  25. package/dist/{utils/math.d.ts → core/pruner/scoring/normalize-scores.d.ts} +4 -0
  26. package/dist/core/segmenter/index.d.ts +1 -0
  27. package/dist/core/{segmenter.d.ts → segmenter/segmenter.d.ts} +11 -11
  28. package/dist/core/utils/metadata/build-video-metadata.d.ts +14 -0
  29. package/dist/core/workspace/index.d.ts +1 -0
  30. package/dist/core/{workspace.d.ts → workspace/workspace.d.ts} +1 -1
  31. package/dist/index.cjs +910 -434
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.mjs +913 -434
  34. package/dist/pipeline-worker.mjs +635 -278
  35. package/dist/types/index.d.ts +25 -0
  36. package/package.json +1 -1
  37. package/dist/constants.d.ts +0 -32
  38. /package/dist/{commands → cli/commands}/Sieve.d.ts +0 -0
  39. /package/dist/{utils → cli/commands}/command-registry.d.ts +0 -0
  40. /package/dist/{components → cli/components}/PhaseStep.d.ts +0 -0
  41. /package/dist/{components → cli/components}/ProgressBar.d.ts +0 -0
  42. /package/dist/core/{pipeline-worker.d.ts → orchestrator/worker/pipeline-worker.d.ts} +0 -0
  43. /package/dist/{utils → core/pruner/heap}/min-heap.d.ts +0 -0
  44. /package/dist/{utils → core/segmenter/scheduling}/concurrency.d.ts +0 -0
  45. /package/dist/{utils → core/utils/filesystem}/paths.d.ts +0 -0
  46. /package/dist/{utils → logging}/logger.d.ts +0 -0
@@ -14,6 +14,7 @@ export interface SieveOptionsBase {
14
14
  threshold?: number;
15
15
  outputPath?: string;
16
16
  fps?: number;
17
+ /** Strict file/buffer candidate frame limit (default: 300); ignored in frames mode. */
17
18
  maxFrames?: number;
18
19
  scale?: number;
19
20
  quality?: number;
@@ -60,8 +61,11 @@ export interface AnimationMetadata {
60
61
  durationMs: number;
61
62
  }
62
63
  export interface VideoMetadata {
64
+ /** Source duration from ffprobe, or the final candidate timestamp in frames mode. */
63
65
  originalDurationMs: number;
66
+ /** Effective sampling frequency; frames mode uses one frame per second. */
64
67
  fps: number;
68
+ /** Actual output JPEG dimensions; zero when no candidate exists. */
65
69
  resolution: {
66
70
  width: number;
67
71
  height: number;
@@ -97,6 +101,15 @@ export interface DBSCANResult {
97
101
  }
98
102
  export interface ProcessContext {
99
103
  options: ResolvedOptions;
104
+ /** Actual extraction grid frequency; frames mode uses one-second intervals. */
105
+ effectiveFps?: number;
106
+ /** Original video duration reported by ffprobe, in seconds. */
107
+ sourceDurationSec?: number;
108
+ /** Dimensions of analysis-space boxes; absent or zero if no pair was analyzed. */
109
+ analysisResolution?: {
110
+ width: number;
111
+ height: number;
112
+ };
100
113
  workspacePath: string;
101
114
  frames: FrameNode[];
102
115
  graph: ScoreEdge[];
@@ -108,16 +121,23 @@ export interface ProcessContext {
108
121
  export interface AnalysisResult {
109
122
  edges: ScoreEdge[];
110
123
  animations: AnimationMetadata[];
124
+ /** First analyzed image dimensions, or zero dimensions when no pair exists. */
125
+ analysisResolution: {
126
+ width: number;
127
+ height: number;
128
+ };
111
129
  }
112
130
  export interface SegmentPlan {
113
131
  index: number;
114
132
  startTime: number;
115
133
  endTime: number;
116
134
  duration: number;
135
+ /** FFmpeg output limit, including overlap slots; a single segment uses the full budget. */
117
136
  allocatedFrames: number;
118
137
  effectiveFps: number;
119
138
  overlapBefore: number;
120
139
  overlapAfter: number;
140
+ /** First extraction grid time in seconds, including overlap. */
121
141
  extractStartTime: number;
122
142
  extractDuration: number;
123
143
  }
@@ -126,4 +146,9 @@ export interface SegmentResult {
126
146
  frames: FrameNode[];
127
147
  edges: ScoreEdge[];
128
148
  animations: AnimationMetadata[];
149
+ /** Analysis coordinates retained through merging for output-only box scaling. */
150
+ analysisResolution: {
151
+ width: number;
152
+ height: number;
153
+ };
129
154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumy-pack/scene-sieve",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "CLI tool for extracting key frames from video and GIF files",
5
5
  "keywords": [
6
6
  "cli",
@@ -1,32 +0,0 @@
1
- export declare const APP_NAME = "scene-sieve";
2
- export declare const DEFAULT_COUNT = 20;
3
- export declare const DEFAULT_THRESHOLD = 0.5;
4
- export declare const DEFAULT_FPS = 5;
5
- export declare const DEFAULT_SCALE = 720;
6
- export declare const DEFAULT_QUALITY = 80;
7
- export declare const DEFAULT_MAX_FRAMES = 300;
8
- export declare const NORMALIZATION_MIN_PERCENTILE = 0.1;
9
- export declare const NORMALIZATION_MAX_PERCENTILE = 0.9;
10
- export declare const NORMALIZATION_LOGISTIC_K = 3;
11
- export declare const NORMALIZATION_ALPHA = 0.4;
12
- export declare const NORMALIZATION_MAD_COEFFICIENT = 1.4826;
13
- export declare const NORMALIZATION_MIN_SAMPLE_SIZE = 10;
14
- export declare const WORKSPACE_PREFIX = "scene-sieve-";
15
- export declare const TEMP_BASE_DIR: string;
16
- export declare const FRAME_OUTPUT_EXTENSION = ".jpg";
17
- export declare const FRAME_FILENAME_PATTERN = "frame_%06d.jpg";
18
- export declare const OPENCV_BATCH_SIZE = 10;
19
- export declare const MIN_IFRAME_COUNT = 3;
20
- export declare const DBSCAN_ALPHA = 0.03;
21
- export declare const DBSCAN_MIN_PTS = 4;
22
- export declare const IOU_THRESHOLD = 0.9;
23
- export declare const DECAY_LAMBDA = 0.95;
24
- export declare const ANIMATION_FRAME_THRESHOLD = 5;
25
- export declare const MATCH_DISTANCE_THRESHOLD = 0.25;
26
- export declare const PIXELDIFF_GAUSSIAN_KERNEL = 3;
27
- export declare const PIXELDIFF_BINARY_THRESHOLD = 30;
28
- export declare const PIXELDIFF_CONTOUR_MIN_AREA = 100;
29
- export declare const PIXELDIFF_SAMPLE_SPACING = 8;
30
- export declare const DEFAULT_MAX_SEGMENT_DURATION = 300;
31
- export declare const DEFAULT_SEGMENT_CONCURRENCY = 2;
32
- export declare function getTempWorkspaceDir(sessionId: string): string;
File without changes
File without changes
File without changes