File tree Expand file tree Collapse file tree
official/projects/waste_identification_ml/llm_applications/milk_pouch_detection Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33This pipeline detects and extracts dairy product packets from a folder of image
44frames.
55
6+ ## Workflow
7+ <!-- disableFinding(SNIPPET_INVALID_LANGUAGE) -->
8+ ``` mermaid
9+ graph TD
10+ Start([Start Pipeline]) --> Init[Parse GCS Path & Batch Size]
11+ Init --> ListFiles["List all image files from GCS<br/>(excluding 'predictions/' folder)"]
12+ ListFiles --> BatchLoop{More files to process?}
13+
14+ subgraph Batch_Processing [Batch Processing Cycle]
15+ direction TB
16+ BatchLoop -- Yes --> Clear[Clear local input/output directories]
17+ Clear --> Download[Download batch to 'input_images/']
18+
19+ Download --> ExtractScript[Run extract_objects.py]
20+
21+ subgraph Extraction [Object Extraction]
22+ ExtractScript --> Detect[Detect & Segment Objects]
23+ Detect --> Filter[Filter Masks by Area]
24+ Filter --> SaveCrops[Save cropped objects to 'objects_for_classification/']
25+ end
26+
27+ SaveCrops --> ClassifyScript[Run classify_images.py]
28+
29+ subgraph Classification [Object Classification]
30+ ClassifyScript --> Predict[Classify Crops using ViT]
31+ Predict --> Sort{Is Dairy?}
32+ Sort -- Yes --> SaveDairy[Move to 'predictions/dairy/']
33+ Sort -- No --> SaveOther[Move to 'predictions/others/']
34+ end
35+
36+ SaveDairy --> Upload[Upload 'predictions/' to GCS]
37+ SaveOther --> Upload
38+ end
39+
40+ Upload --> BatchLoop
41+ BatchLoop -- No --> End([End Pipeline])
42+ ```
43+
644We offer two types of deployment approaches:
745
846## Deployment Approaches
You can’t perform that action at this time.
0 commit comments