This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pydaisi as pyd | |
add_two_numbers = pyd.Daisi("exampledaisies/Add Two Numbers") | |
first_sum = add_two_numbers.compute(firstNumber=5, secondNumber=6) | |
second_sum = add_two_numbers.compute(firstNumber=2, secondNumber=1) | |
add_two_numbers.compute(firstNumber=first_sum, secondNumber=second_sum).value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pydaisi as pyd | |
add_two_numbers = pyd.Daisi("exampledaisies/Add Two Numbers") | |
add_two_numbers.compute(firstNumber=5, secondNumber=6).value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rdaisi) | |
configure_daisi(python_path = "/usr/local/bin/python3") | |
principal_components_analysis <- Daisi("erichare/Principal Components Analysis") | |
principal_components_analysis$fit_pca(df=NULL, vars=NULL, n_components=2)$value() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pydaisi as pyd | |
principal_components_analysis = pyd.Daisi("erichare/Principal Components Analysis") | |
pca_data = principal_components_analysis.fit_pca(df=None, vars=None, n_components=2).value | |
pca_data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fit_pca(pca_data, x_component=1, y_component=2, split_by=None): | |
... | |
pca_df = df[vars] | |
pca = PCA(n_components=n_components) | |
pca.fit(pca_df) | |
... | |
pca_data = pd.DataFrame(pca.fit_transform(pca_df)) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def yolo(image: np.ndarray=None, return_type: list=["Image", "Labels"]): | |
... | |
inferer = Inferer(source, weights, device="", yaml="coco.yaml", | |
img_size=new_width, half=False) | |
inferer.infer(conf_thres=.25, iou_thres=.45, classes=None, | |
agnostic_nms=False, max_det=1000, save_dir=tmpdir, | |
save_txt=save_txt, save_img=save_img, hide_labels=False, hide_conf=False) | |
... | |
return yolo_result, label_result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pydaisi as pyd | |
from PIL import Image | |
yolo_object_detection = pyd.Daisi("erichare/YOLO v6 Object Detection") | |
img = Image.open("busystreet.png") | |
img.load() | |
yolo_result = yolo_object_detection.yolo(img, return_type=['Image']).value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> gn_daisi <- Daisi("GoogleNews") | |
[1] "Looking for Daisi: GoogleNews" | |
[1] "https://app.daisi.io/pebble-api/daisies/connect?name=GoogleNews" | |
> gn_execution <- gn_daisi$get_news(query = "Apple", num = 6) | |
[1] "Executing Daisi: 4cc93acc-ac2d-4c3b-aeac-f67e96a5c658" | |
> gn_execution$value()[,1:3] | |
[1] "Fetching Result: b76e037a-7c7b-4c2f-8a22-cf561ca398aa" | |
title desc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bert_daisi <- Daisi("Ask BERT") | |
[1] "Looking for Daisi: Ask BERT" | |
[1] "https://app.daisi.io/pebble-api/daisies/connect?name=Ask%20BERT" | |
> bert_execution <- bert_daisi$compute(context = "Daisi seamlessly integrates the immense power of cloud computing into the workspace of every data scientist. If you are writing data science, AI, or Machine Learning applications, contact us for a free sneak peak of Daisi – the cloud platform to deploy, share, and discover Python serverless functions.", query = "What are Daisies for?") | |
> bert_execution$value() | |
[1] "Fetching Result: 4715353b-9703-452d-82fa-88ca7af3fcbe" | |
[[1]] | |
[1] "to deploy, share, and discover Python serverless functions." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> titanic_daisi <- Daisi("Titanic Statistics") | |
[1] "Looking for Daisi: Titanic Statistics" | |
[1] "https://app.daisi.io/pebble-api/daisies/connect?name=Titanic%20Statistics" | |
> titanic_execution <- titanic_daisi$raw(rows = 8) | |
> titanic_execution$value() | |
[1] "Fetching Result: c2395f17-44a6-459c-b17c-60e394bd4f3e" | |
PassengerId Sex Age SibSp Parch | |
1 1 male 22 1 0 | |
2 2 female 38 1 0 |