Coretex Docs
LearnTutorialsPython libraryFAQ
  • Welcome to Coretex.ai!
  • Getting started
    • 🎓Learn Coretex
      • đŸ‘ĨOrganization
      • đŸ–Ĩī¸Project and Task
      • 🔍Type
        • 🏃Motion Recognition
        • 📷Computer Vision
        • 👩‍đŸ”ŦBioinformatics
        • đŸ¤ˇâ€â™‚ī¸Other
      • 📚Dataset
      • â˜ī¸Node
      • 🚀Endpoints
    • 👩‍đŸ’ģTutorials
      • 🤩Run your first workflow
      • 🛸Migrate your tasks to Coretex
      • đŸ’ģLocal Datasets and Runs
      • đŸ§ŦMicrobiome analysis using Qiime2
      • 👨‍đŸ”ŦDNA forensics
      • 📷Hand recognition
      • â›šī¸â€â™‚ī¸IMU activity recognition
      • 🔓User-Owned AI
    • ❓FAQ
  • Advanced
    • đŸ–Ĩī¸Coretex CLI
      • 📀Coretex CLI Setup
      • 🔧Setting up Coretex Node
      • 🧊Kubernetes Cluster Node
      • 📓Troubleshooting
    • 📋Data handling in Coretex
    • 👍Best Practices
    • 🔑Encryption protocol
Powered by GitBook
On this page
  • Local Dataset
  • Local Experiment

Was this helpful?

  1. Getting started
  2. Tutorials

Local Datasets and Runs

PreviousMigrate your tasks to CoretexNextMicrobiome analysis using Qiime2

Last updated 9 months ago

Was this helpful?

This walkthrough will teach you how to start Runs locally on you machine and use local datasets on the Coretex platform.

Local Dataset

Using your Local Datasets on the Coretex platform is very simple. First, install the Coretex library using pip:

pip install coretex

In your python code you will have to import the Dataset class of type that you want to use (i.e. ObjectDetectionDataset) and its local class which usually has the same name with the prefix "Local" (i.e. LocalObjectDetectionDataset).

from coretex import ObjectDetectionDataset, LocalObjectDetectionDataset

In this example, we use CustomDataset type which is used for undefined Project Types (). To learn more about Project Types check out this link: .

Only one modification in your task code is necessary in order to use the local Dataset.

In main.py file in main() function at its very beginning you will need to specify your local Dataset path. Like this:

from pathlib import Path

from coretex import CustomDataset, LocalCustomDataset, ExecutingExperiment
from coretex.project import initializeProject


def main(experiment: ExecutingExperiment[CustomDataset]) -> None:
    
    
    # pass your dataset to train() function    
    model = train(dataset = experiment.dataset)
    
    # validate the trained model
    validate(model = model)


if __name__ == "__main__":
    initializeProject(main)

This line has to be at the very beginning of your main()function in your task.

You can access your dataset samples using:

experiment.dataset.samples  # list of all samples in the dataset

# use simple list iteration to access each sample in the dataset

for sample in dataset.samples:
    sample.unzip()  # unzips sample
    sampleData = sample.load()  # access sample's data like name, path, etc.

Local Experiment

Starting local Runs on your machine using Coretex is straightforward.

The first step is downloading the Coretex library through PyPi:

pip install coretex

The next step is making the necessary changes, required for running the Task on the Coretex platform.

After you've done all necessary modifications, open your terminal and write the following:

python main.py --username user@mail.com --password ******* --projectId 1023

This will start the Coretex Run on your machine locally. Message output of successful start will look something like this:

>> [MLService] Login successful

This message is a sign of successful authentication. Keep in mind that you have to specify an id of your Coretex dataset in the experiment.config file or to set up a local Dataset in your task.

Refer to this tutorial to find out more about those changes: .

👩‍đŸ’ģ
đŸ’ģ
Other
Types
Migrate your
tasks to Coretex