Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

[WIP] add basic pico nodes - nodes PR:329 #445

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "These dataframes should both be single columns.",
"long_description": "These dataframes should both be single columns.",
"short_description": "The ACCURACY node takes two dataframes with the true and predicted labels from a classification task, and indicates whether the prediction was correct or not.",
"parameters": [
{
"name": "true_label",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Inputs\n------\ndata : DataFrame\n The input dataframe containing the categorical features.",
"long_description": "Inputs\n------\ndata : DataFrame\n The input dataframe containing the categorical features.",
"short_description": "The ONE_HOT_ENCODING node creates a one hot encoding from a dataframe containing categorical features.",
"parameters": [
{
"name": "feature_col",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "It takes two dataframes of label and feature from labelled training data and a dataframe of unlabelled input data.",
"long_description": "It takes two dataframes of label and feature from labelled training data and a dataframe of unlabelled input data.",
"short_description": "The SUPPORT_VECTOR_MACHINE node is used to train a support vector machine model for classification tasks.",
"parameters": [
{
"name": "kernel",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Inputs\n----------\ninput_image : Image\n The image to classify.\nclass_names : DataFrame\n A dataframe containing the class names.",
"long_description": "Inputs\n----------\ninput_image : Image\n The image to classify.\nclass_names : DataFrame\n A dataframe containing the class names.",
"short_description": "Execute a torchscript classifier against an input image.",
"parameters": [
{
"name": "model_path",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": null,
"long_description": null,
"short_description": "The TRAIN_TEST_SPLIT node is used to split the data into test and training according to a size specified before any ML tasks.",
"parameters": [
{
"name": "test_size",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": null,
"long_description": null,
"short_description": "The NLP_CONNECT_VIT_GPT2 node captions an input image and produces an output string wrapped in a dataframe.",
"parameters": [],
"returns": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "For more information about Vision Transformers,\nsee: https://huggingface.co/google/vit-base-patch16-224\n\nFor a complete list of models, see:\nhttps://huggingface.co/models?pipeline_tag=image-classification\n\nFor examples of how revision parameters (such as 'main') is used,\nsee: https://huggingface.co/google/vit-base-patch16-224/commits/main",
"long_description": "For more information about Vision Transformers,\nsee: https://huggingface.co/google/vit-base-patch16-224\n\nFor a complete list of models, see:\nhttps://huggingface.co/models?pipeline_tag=image-classification\n\nFor examples of how revision parameters (such as 'main') is used,\nsee: https://huggingface.co/google/vit-base-patch16-224/commits/main",
"short_description": "The HUGGING_FACE_PIPELINE node uses a classification pipeline to process and classify an image.",
"parameters": [
{
"name": "default",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "This allows supporting a wide range of deep learning frameworks and hardware platforms.",
"long_description": "This allows supporting a wide range of deep learning frameworks and hardware platforms.",
"short_description": "ONNX_MODEL loads a serialized ONNX model and uses it to make predictions using ONNX Runtime.",
"parameters": [
{
"name": "file_path",
Expand Down
66 changes: 66 additions & 0 deletions docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/examples/EX1/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"rfInstance": {
"nodes": [
{
"width": 208,
"height": 96,
"id": "ONNX_MODEL-3bfae6ce-ad2f-4d4d-8342-96d824eb7380",
"type": "AI_ML",
"data": {
"id": "ONNX_MODEL-3bfae6ce-ad2f-4d4d-8342-96d824eb7380",
"label": "ONNX MODEL",
"func": "ONNX_MODEL",
"type": "AI_ML",
"ctrls": {
"file_path": {
"type": "str",
"default": null,
"desc": "Path to a ONNX model to load and use for prediction.",
"overload": null,
"functionName": "ONNX_MODEL",
"param": "file_path",
"value": ""
}
},
"initCtrls": {},
"inputs": [
{
"name": "default",
"id": "default",
"type": "Vector",
"multiple": false,
"desc": "The input tensor to use for prediction.\nFor now, only a single input tensor is supported.\nNote that the input tensor shape is not checked against the model's input shape."
}
],
"outputs": [
{
"name": "default",
"id": "default",
"type": "Vector",
"desc": "The predictions made by the ONNX model.\nFor now, only a single output tensor is supported."
}
],
"path": "AI_ML/LOAD_MODEL/ONNX_MODEL/ONNX_MODEL.py",
"selected": true
},
"position": {
"x": -171.967500985471,
"y": -191.24623740170063
},
"selected": true,
"positionAbsolute": {
"x": -171.967500985471,
"y": -191.24623740170063
},
"dragging": true
}
],
"edges": [],
"viewport": {
"x": 669.537650867023,
"y": 395.1114317341454,
"zoom": 0.7467072297113905
}
},
"textNodes": []
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": null,
"long_description": null,
"short_description": "The COUNT_VECTORIZER node receives a collection (matrix, vector or dataframe) of text documents and converts it to a matrix of token counts.",
"parameters": [],
"returns": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Inputs\n------\ndefault : Image",
"long_description": "Inputs\n------\ndefault : Image",
"short_description": "The OBJECT_DETECTION node detects objects in the input image, and returns an 'image' DataContainer with those objects highlighted.",
"parameters": [],
"returns": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "The DataContainer input type must be a dataframe, and the first column (or index) of the dataframe must be of a datetime type.\n\nThis node always returns a DataContainer of a dataframe type. It will also always return an 'extra' field with a key 'prophet' of which the value is the JSONified Prophet model.\nThis model can be loaded as follows:\n\n ```python\n from prophet.serialize import model_from_json\n\n model = model_from_json(dc_inputs.extra[\"prophet\"])\n ```",
"long_description": "The DataContainer input type must be a dataframe, and the first column (or index) of the dataframe must be of a datetime type.\n\nThis node always returns a DataContainer of a dataframe type. It will also always return an 'extra' field with a key 'prophet' of which the value is the JSONified Prophet model.\nThis model can be loaded as follows:",
"short_description": "The PROPHET_PREDICT node runs a Prophet model on the incoming dataframe.",
"parameters": [
{
"name": "run_forecast",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ The PROPHET_PREDICT node runs a Prophet model on the incoming dataframe.
This node always returns a DataContainer of a dataframe type. It will also always return an 'extra' field with a key 'prophet' of which the value is the JSONified Prophet model.
This model can be loaded as follows:

```python
from prophet.serialize import model_from_json

model = model_from_json(dc_inputs.extra["prophet"])
```

Parameters
----------
run_forecast : bool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from flojoy import flojoy, run_in_venv, DataFrame
from flojoy import DataFrame, flojoy, run_in_venv


@flojoy
@run_in_venv(
pip_dependencies=[
"prophet==1.1.4",
"prophet==1.1.5",
]
)
def PROPHET_PREDICT(
Expand All @@ -14,9 +14,9 @@ def PROPHET_PREDICT(

import os
import sys
import pandas as pd
import numpy as np

import numpy as np
import pandas as pd
import prophet
from prophet.serialize import model_to_json

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": null,
"long_description": null,
"short_description": "The LEAST_SQUARE node computes the coefficients that minimize the distance between the inputs 'Matrix' or 'OrderedPair' class and the regression.",
"parameters": [],
"returns": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "The input image is expected to be a DataContainer of an 'image' type.\n\nThe output is a DataContainer of an 'image' type with the same dimensions as the input image, but with the red, green, and blue channels replaced with the segmentation mask.",
"long_description": "The input image is expected to be a DataContainer of an 'image' type.\n\nThe output is a DataContainer of an 'image' type with the same dimensions as the input image, but with the red, green, and blue channels replaced with the segmentation mask.",
"short_description": "The DEEPLAB_V3 node returns a segmentation mask from an input image in a dataframe.",
"parameters": [],
"returns": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "The \"summary_text\" column contains a summary of the text in the corresponding row of the input dataframe.",
"long_description": "The \"summary_text\" column contains a summary of the text in the corresponding row of the input dataframe.",
"short_description": "The BART_LARGE_CNN node takes an input dataframe with multiple rows and a single column, and produces a dataframe with a single \"summary_text\" column.",
"parameters": [],
"returns": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Inputs\n------\ndefault : DataFrame|Matrix\n Input to use as the table for column extraction",
"long_description": "Inputs\n------\ndefault : DataFrame|Matrix\n Input to use as the table for column extraction",
"short_description": "The EXTRACT_COLUMNS node takes an input dataframe/matrix and returns a dataframe/matrix with only the specified columns.",
"parameters": [
{
"name": "columns",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Must use the TEXT_VIEW node to view the text.",
"long_description": "Must use the TEXT_VIEW node to view the text.",
"short_description": "The DATACONTAINER_TYPE node returns a TextBlob containing the input DataContainer type (e.g. Vector).",
"parameters": [],
"returns": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Must use the TEXT_VIEW node to view the text.",
"long_description": "Must use the TEXT_VIEW node to view the text.",
"short_description": "The DC_CONTENT_TYPE node returns a TextBlob containing the type of the input DataContainer's content.",
"parameters": [],
"returns": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Must use the TEXT_VIEW node to view the text.",
"long_description": "Must use the TEXT_VIEW node to view the text.",
"short_description": "The PRINT_DATACONTAINER node returns a TextBlob containing input DataContainer information.",
"parameters": [],
"returns": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Inputs\n------\ndefault: None",
"long_description": "Inputs\n------\ndefault: None",
"short_description": "The OPEN_IMAGE node loads an image file from disk and returns an image type DataContainer object.",
"parameters": [
{
"name": "file_path",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Inputs\n------\ndefault: None",
"long_description": "Inputs\n------\ndefault: None",
"short_description": "The OPEN_PARQUET node loads a local file of the .parquet file format. It then returns the file as a pandas.Dataframe type.",
"parameters": [
{
"name": "file_path",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": null,
"long_description": null,
"short_description": "The READ_CSV node reads a .csv file from disk or a URL, and then returns a dataframe.",
"parameters": [
{
"name": "file_path",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Inputs\n------\ndefault: None",
"long_description": "Inputs\n------\ndefault: None",
"short_description": "The READ_S3 node takes a S3_key name, S3 bucket name, and file name as input, and extracts the file from the specified bucket using the S3_key that was saved.",
"parameters": [
{
"name": "s3_name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": null,
"long_description": null,
"short_description": "The PLOTLY_DATASET node retrieves a pandas DataFrame from a Plotly built-in dataset using the provided dataset_key parameter and returns it wrapped in a Flojoy DataFrame class.",
"parameters": [
{
"name": "dataset_key",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "'sklearn.datasets', using the provided dataset_key parameter, and returns\nit wrapped in a DataContainer.",
"long_description": "'sklearn.datasets', using the provided dataset_key parameter, and returns\nit wrapped in a DataContainer.",
"short_description": "The SCIKIT_LEARN_DATASET node retrieves a pandas DataFrame from",
"parameters": [
{
"name": "dataset_name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "The data is returned as a dataframe with one column containing the text and the other containing the category.",
"long_description": "The data is returned as a dataframe with one column containing the text and the other containing the category.",
"short_description": "The TEXT_DATASET node loads the 20 newsgroups dataset from scikit-learn.",
"parameters": [
{
"name": "subset",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Examples can be found here:\nhttps://scikit-image.org/docs/stable/auto_examples/index.html",
"long_description": "Examples can be found here:\nhttps://scikit-image.org/docs/stable/auto_examples/index.html",
"short_description": "The SKIMAGE node is designed to load example images from 'scikit-image'.",
"parameters": [
{
"name": "img_key",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "It offers a more straightforward way to generate signals, with sample rate and the time in seconds as parameters, along with all the parameters in the SINE node.",
"long_description": "It offers a more straightforward way to generate signals, with sample rate and the time in seconds as parameters, along with all the parameters in the SINE node.",
"short_description": "The BASIC_OSCILLATOR node is a combination of the LINSPACE and SINE nodes.",
"parameters": [
{
"name": "sample_rate",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Inputs\n------\ndefault : OrderedPair|Vector\n Optional input that defines the size of the output.",
"long_description": "Inputs\n------\ndefault : OrderedPair|Vector\n Optional input that defines the size of the output.",
"short_description": "The CONSTANT node generates a single x-y vector of numeric (floating point) constants.",
"parameters": [
{
"name": "dc_type",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": null,
"long_description": null,
"short_description": "The FEEDBACK node captures the result of the specified node ID. If the result is not found, it passes the result of the parent node.",
"parameters": [
{
"name": "referred_node",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from typing import Optional, Any
from typing import Any, Optional

from flojoy import (
flojoy,
DataContainer,
get_job_result,
NodeReference,
JobResultBuilder,
NodeReference,
flojoy,
get_job_result,
)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "It uses the 'linspace' numpy function. It is useful for generating an x-axis for the OrderedPair data type.\n\nInputs\n------\ndefault : OrderedPair\n Optional input in case LINSPACE is used in a loop. Not used.",
"long_description": "It uses the 'linspace' numpy function. It is useful for generating an x-axis for the OrderedPair data type.\n\nInputs\n------\ndefault : OrderedPair\n Optional input in case LINSPACE is used in a loop. Not used.",
"short_description": "The LINSPACE node generates data spaced evenly between two points.",
"parameters": [
{
"name": "start",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Based on these inputs, it generates a random matrix where the integers inside the matrix are between 0 and 19.",
"long_description": "Based on these inputs, it generates a random matrix where the integers inside the matrix are between 0 and 19.",
"short_description": "The MATRIX node takes two arguments, 'row' and 'col', as input.",
"parameters": [
{
"name": "row",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Inputs\n------\ndefault : OrderedPair|Vector\n Input to use as the x-axis for the random samples.",
"long_description": "Inputs\n------\ndefault : OrderedPair|Vector\n Input to use as the x-axis for the random samples.",
"short_description": "The POPULATE node generates random numbers, depending on the distribution selected and the input data.",
"parameters": [
{
"name": "distribution",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": "Inputs\n------\ndefault : DataContainer\n unused in this node",
"long_description": "Inputs\n------\ndefault : DataContainer\n unused in this node",
"short_description": "The RAND node generates a random number or a list of random numbers, depending on the distribution selected.",
"parameters": [
{
"name": "distribution",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"description": null,
"long_description": null,
"short_description": "The SCALAR node returns a single Scalar value.",
"parameters": [
{
"name": "value",
Expand Down
Loading