Contribute a new package
1. Location and structure
A new module in ecos_core should place in side the ecos_core
folder.
The module should have structure as follows.
<new_module>
└── sample_code/
└── <new_module>.py
└── CHANGELOG.md
└── README.md
└── requirements.txt
where,
Item | Description |
---|---|
sample_code | Folder contains all sample codes that use the current module |
<new_module>.py | The main file that contains transform(), fit(), predict(). Lowcases. |
CHANGELOG.md | A log for version management |
README.md | Notes on how to use the module |
requirements.txt | List of dependencies |
The usage of the module will be explained more in Docs
(this document).
Note
For efficience, we will keep the minimal number of modules based on their application. If a module have a new version, the old vesrsion will be removed after we verify the usability of the new one.
2. 3rd party dependency
If the package depends on a 3rd party lib that cannot install via pip install
, developer can:
-
Copy the content of the 3rd party lib into
third-party-libs
folder -
Modify the setup.py for additionally installing the 3rd party lib beforehands
3. Rules when create a new package
If the package derived from an external source and verified, the procedures are as follows
-
Create new package inside the
ecos_core
folder -
Add
<package_name>.py
file withModel()
class and the following methods:build_model(custom_weight)
: for creating new model with custom weight path (if provided)fit()
: for trainning new modelpredict(img_path)
: for predicting result for a single image
-
Remove all the unneccessary code from external source.
-
Write an unittest in
tests
folder
Tip
Keep the package on ecos_core as simple as possible