1+ #! /bin/bash
2+
3+ cat << EOF
4+ This script automates the execution of an Circularnet pipeline for image
5+ processing.
6+ Steps Performed:
7+ 1. Activates the Python virtual environment named 'myenv'.
8+ 2. Validates successful activation of the virtual environment.
9+ 3. Executes the 'pipeline_images.py' script with the following parameters:
10+ Parameters:
11+ --input_directory : GCS directory where the input images are stored for
12+ inference.
13+ --output_directory : GCS directory where the model inference outputs will be
14+ saved.
15+ --height : Height to which input images are resized for the Mask
16+ R-CNN model.
17+ --width : Width to which input images are resized for the Mask
18+ R-CNN model.
19+ --model : Name of the model to download and use for inference.
20+ --score : Confidence threshold for detections during
21+ inference.
22+ --search_range_x : Max pixel movement allowed in the X direction for
23+ object tracking between missed frames.
24+ --search_range_y : Max pixel movement allowed in the Y direction for
25+ object tracking between missed frames.
26+ --memory : Number of frames an object can be missed and still
27+ be tracked.
28+ --project_id : Google Cloud Project ID for BigQuery operations.
29+ --bq_dataset_id : BigQuery Dataset ID where results will be stored.
30+ --bq_table_id : BigQuery Table ID where results will be stored.
31+ --overwrite : If set to True, overwrites the pre-existing
32+ BigQuery table.
33+ --tracking_visualization : If set to True, visualizes the tracking results
34+ from the tracking algorithm.
35+ --cropped_objects : If set to True, crops the objects per category
36+ according to the prediction and tracking results.
37+ EOF
38+ # Activate the virtual environment
39+ source myenv/bin/activate
40+ # Check if the virtual environment is activated
41+ if [[ " $VIRTUAL_ENV " != " " ]]; then
42+ echo " Virtual environment 'myenv' activated successfully."
43+ else
44+ echo " Failed to activate virtual environment. Exiting."
45+ exit 1
46+ fi
47+ python inference_pipeline.py \
48+ --input_directory=gs://recykal/TestData/SmallTestData \
49+ --output_directory=gs://recykal/TestData/SmallTestData \
50+ --model=detr_seg \
51+ --score=0.50 \
52+ --search_range_x=150 \
53+ --search_range_y=20 \
54+ --memory=3 \
55+ --project_id=waste-identification-ml-330916 \
56+ --bq_dataset_id=circularnet_dataset \
57+ --bq_table_id=vinit_test_table1 \
58+ --overwrite=True
0 commit comments