zamba.models.depth_estimation.config¶
Attributes¶
Classes¶
DepthEstimationConfig
¶
Bases: ZambaBaseModel
Configuration for running depth estimation on videos.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepaths |
FilePath
|
Path to a CSV containing videos for inference, with one row per video in the data_dir. There must be a column called 'filepath' (absolute or relative to the data_dir). If None, uses all files in data_dir. Defaults to None. |
required |
data_dir |
DirectoryPath
|
Path to a directory containing videos for inference. Defaults to the working directory. |
required |
save_to |
Path or DirectoryPath
|
Either a filename or a directory in which to save the output csv. If a directory is provided, predictions will be saved to depth_predictions.csv in that directory. Defaults to the working directory. |
required |
overwrite |
bool
|
If True, overwrite output csv path if it exists. Defaults to False. |
required |
batch_size |
int
|
Batch size to use for inference. Defaults to 64. Note: a batch is a set of frames, not videos, for the depth model. |
required |
model_cache_dir |
Path
|
Path for downloading and saving model weights.
Defaults to env var |
required |
weight_download_region |
str
|
s3 region to download pretrained weights from. Options are "us" (United States), "eu" (Europe), or "asia" (Asia Pacific). Defaults to "us". |
required |
num_workers |
int
|
Number of subprocesses to use for data loading. The maximum value is the number of CPUs in the system. Defaults to 8. |
required |
gpus |
int
|
Number of GPUs to use for inference. Defaults to all of the available GPUs found on the machine. |
required |
Source code in zamba/models/depth_estimation/config.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
Attributes¶
batch_size: int = 64
class-attribute
¶
data_dir: DirectoryPath = ''
class-attribute
¶
filepaths: Optional[Union[FilePath, pd.DataFrame]] = None
class-attribute
¶
gpus: int = GPUS_AVAILABLE
class-attribute
¶
model_cache_dir: Optional[Path] = None
class-attribute
¶
num_workers: int = 8
class-attribute
¶
overwrite: bool = False
class-attribute
¶
save_to: Optional[Path] = None
class-attribute
¶
weight_download_region: RegionEnum = RegionEnum('us')
class-attribute
¶
Classes¶
Config
¶
Functions¶
run_model()
¶
Source code in zamba/models/depth_estimation/config.py
60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
validate_files(values)
¶
Source code in zamba/models/depth_estimation/config.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
validate_save_to(values)
¶
Source code in zamba/models/depth_estimation/config.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|