diff --git a/.github/workflows/docs.yaml b/.github/workflows/publish-docs.yaml similarity index 74% rename from .github/workflows/docs.yaml rename to .github/workflows/publish-docs.yaml index e8f41676..6d8acf29 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -1,21 +1,18 @@ -name: docs +name: publish-docs on: push: paths: # Only run this workflow if there are changes in any of these files. - .github/workflows/** - docs/** - pull_request: - paths: - # Only run this workflow if there are changes in any of these files. - - .github/workflows/** - - docs/** + branches: + - main defaults: run: working-directory: docs jobs: - deploy: + deploy-docs: runs-on: ubuntu-latest steps: - name: Get code @@ -32,12 +29,13 @@ jobs: - name: Deploy website # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus uses: peaceiris/actions-gh-pages@v3 - # Only run this on pushes to the `main` branch (try-docusaurus-base is temporary for testing) - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/try-docusaurus-base' + # Only run this on pushes to the `docs` + if: github.ref == 'refs/heads/docs' with: github_token: ${{ secrets.GITHUB_TOKEN }} - # Build output to publish to the `gh-pages` branch: publish_dir: ./docs/build + #TODO: setup a staging directory when doing a PR + #destination_dir: staging # The following lines assign commit authorship to the official # GH-Actions bot for deploys to `gh-pages` branch: # https://github.com/actions/checkout/issues/13#issuecomment-724415212 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish-pypi.yaml similarity index 100% rename from .github/workflows/publish.yaml rename to .github/workflows/publish-pypi.yaml diff --git a/.github/workflows/test-integ.yaml b/.github/workflows/test-integ.yaml index 67d4b860..e5744a28 100644 --- a/.github/workflows/test-integ.yaml +++ b/.github/workflows/test-integ.yaml @@ -1,6 +1,10 @@ # Run integration tests against the integ API endpoint name: test integ -on: [push] +on: + push: + branches: + - main + pull_request: jobs: run-tests: runs-on: ubuntu-20.04 @@ -16,14 +20,14 @@ jobs: matrix: python-version: [ #"3.6", # Default on Ubuntu18.04 but openapi-generator fails - "3.7", - "3.8", - "3.9", - "3.10", + "3.7", + "3.8", + "3.9", + "3.10", "3.11", - ] - install_numpy: [ true, false ] - install_pillow: [ true, false ] + ] + install_numpy: [true, false] + install_pillow: [true, false] env: # This is associated with the "sdk-integ-test" user, credentials on 1password GROUNDLIGHT_API_TOKEN: ${{ secrets.GROUNDLIGHT_API_TOKEN }} diff --git a/.gitignore b/.gitignore index d9e7d61a..97e36f57 100644 --- a/.gitignore +++ b/.gitignore @@ -166,3 +166,5 @@ node_modules/ *.swp **/.python-version + +.DS_Store diff --git a/README.md b/README.md index 40ec76b0..fb068fcd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Groundlight Python SDK -Check out our [documentation here](https://groundlight.github.io/python-sdk/docs/getting-started)! +Groundlight makes it simple to build reliable visual applications. Read the [full documentation here](https://code.groundlight.ai/python-sdk/). -## Computer vision made simple +## Computer Vision powered by Natural Language ```bash pip install groundlight @@ -24,3 +24,13 @@ print(f"The answer is {image_query.result}") Your images are first analyzed by machine learning (ML) models which are automatically trained on your data. If those models have high enough confidence, that's your answer. But if the models are unsure, then the images are progressively escalated to more resource-intensive analysis methods up to real-time human review. So what you get is a computer vision system that starts working right away without even needing to first gather and label a dataset. At first it will operate with high latency, because people need to review the image queries. But over time, the ML systems will learn and improve so queries come back faster with higher confidence. _Note: The SDK is currently in "beta" phase. Interfaces are subject to change in future versions._ + +## Learn more + +Some more resources you might like: + +* [Code Documentation](https://code.groundlight.ai/) +* [Python SDK](https://pypi.org/project/groundlight/) +* [Company](https://www.groundlight.ai/) +* [Login to Groundlight](https://app.groundlight.ai/) + diff --git a/docs/blog/2023-04-01-mdx-blog-post.mdx b/docs/blog/2023-04-01-mdx-blog-post.mdx deleted file mode 100644 index f1877f9b..00000000 --- a/docs/blog/2023-04-01-mdx-blog-post.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -slug: mdx-blog-post -title: MDX Blog Post -authors: [michael] -tags: [docusaurus, markdown, mdx] ---- - -Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/). - -:::tip - -Use the power of React to create interactive blog posts. - -```js - -``` - - - -::: diff --git a/docs/blog/2023-04-02-welcome/docusaurus-plushie-banner.jpeg b/docs/blog/2023-04-02-welcome/docusaurus-plushie-banner.jpeg deleted file mode 100644 index 11bda092..00000000 Binary files a/docs/blog/2023-04-02-welcome/docusaurus-plushie-banner.jpeg and /dev/null differ diff --git a/docs/blog/2023-04-02-welcome/index.md b/docs/blog/2023-04-02-welcome/index.md deleted file mode 100644 index e24e2149..00000000 --- a/docs/blog/2023-04-02-welcome/index.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -slug: welcome -title: Welcome -authors: [michael] -tags: [hello, docusaurus] ---- - -[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog). - -Simply add Markdown files (or folders) to the `blog` directory. - -Regular blog authors can be added to `authors.yml`. - -The blog post date can be extracted from filenames, such as: - -- `2019-05-30-welcome.md` -- `2019-05-30-welcome/index.md` - -A blog post folder can be convenient to co-locate blog post images: - -![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg) - -The blog supports tags as well! - -**And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config. diff --git a/docs/blog/authors.yml b/docs/blog/authors.yml deleted file mode 100644 index 94a79d1d..00000000 --- a/docs/blog/authors.yml +++ /dev/null @@ -1,4 +0,0 @@ -michael: - name: Michael Vogelsong - url: https://github.com/mjvogelsong - image_url: https://github.com/mjvogelsong.png diff --git a/docs/docs/building-applications/_category_.json b/docs/docs/building-applications/_category_.json index b6837bbe..dcc05d3a 100644 --- a/docs/docs/building-applications/_category_.json +++ b/docs/docs/building-applications/_category_.json @@ -3,6 +3,6 @@ "position": 2, "link": { "type": "generated-index", - "description": "Let's build some apps!" + "description": "Let's build some reliable vision applications." } } diff --git a/docs/docs/building-applications/edge.md b/docs/docs/building-applications/edge.md index 832cdd7d..4487ab29 100644 --- a/docs/docs/building-applications/edge.md +++ b/docs/docs/building-applications/edge.md @@ -7,4 +7,4 @@ from groundlight import Groundlight gl = Groundlight(endpoint="http://localhost:6717") ``` -(Edge model download is not yet generally available.) +(Edge model download is not yet generally available. Work with your Solutions Engineer to set up edge inference.) diff --git a/docs/docs/getting-started/getting-started.mdx b/docs/docs/getting-started/getting-started.mdx index a267f35d..ba3f2769 100644 --- a/docs/docs/getting-started/getting-started.mdx +++ b/docs/docs/getting-started/getting-started.mdx @@ -1,6 +1,6 @@ # Getting Started -## Computer vision made simple +## Computer Vision powered by Natural Language Build a working computer vision system in just 5 lines of python: diff --git a/docs/docs/getting-started/managing-confidence.md b/docs/docs/getting-started/managing-confidence.md index 127e9e24..6bbd5960 100644 --- a/docs/docs/getting-started/managing-confidence.md +++ b/docs/docs/getting-started/managing-confidence.md @@ -15,7 +15,8 @@ print(f"The answer is {image_query.result}") :::tip -Add a tip here! +Tuning confidence lets you balance accuracy against latency. +Higher confidence will get higher accuracy, but will generally require longer latency. ::: diff --git a/docs/docs/installation/_category_.json b/docs/docs/installation/_category_.json new file mode 100644 index 00000000..7b7bb5d6 --- /dev/null +++ b/docs/docs/installation/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "Installation", + "position": 3, + "link": { + "type": "generated-index", + "description": "Installing on various platforms" + } +} diff --git a/docs/docs/installation/libraries-numpy-pil.md b/docs/docs/installation/libraries-numpy-pil.md new file mode 100644 index 00000000..8d7c97e8 --- /dev/null +++ b/docs/docs/installation/libraries-numpy-pil.md @@ -0,0 +1,41 @@ +# Numpy, PIL, OpenCV - using common libraries + +## Smaller is better! + +Groundlight is optimized to run on small edge devices. As such, you can use the Groundlight SDK without +installing large libraries like `numpy` or `PIL` or `OpenCV`. + +But if you're already installing them, we'll use them. Our SDK detects if these libraries are installed +and will make use of them if they're present. If not, we'll gracefully degrade, and tell you what's +wrong if you try to use these features. + +## Numpy + +The Groundlight SDK can accept images as `numpy` arrays. They should be in the standard HWN format in RGB color order. +Pixel values should be from 0-255 (not 0.0-1.0 as floats). SO `uint8` data type is preferable since it saves memory. + +Here's sample code to create an 800x600 random image in numpy: + +``` +import numpy as np + +img = np_img = np.random.uniform(0, 255, (600, 800, 3)) +``` + +## PIL + +The Groundlight SDK can accept PIL images directly in `submit_image_query`. + + +## OpenCV + +OpenCV creates images that are stored as numpy arrays. So can send them to `submit_image_query` directly. +BUT! OpenCV uses BGR color order, not RGB. You can reverse them as follows: + +``` +rgb_img = bgr_img[:, :, ::-1] +``` + +See [Issue #34](https://github.com/groundlight/python-sdk/issues/34) for a discussion about OpenCV support. + + diff --git a/docs/docs/installation/linux-windows-mac.md b/docs/docs/installation/linux-windows-mac.md new file mode 100644 index 00000000..80e34a20 --- /dev/null +++ b/docs/docs/installation/linux-windows-mac.md @@ -0,0 +1,16 @@ +# Windows, Linux, Mac + +Installation on common platforms is simple. Just get `python3`, `pip`, and you're ready to go. + +## Python 3.7 or newer + +Groundlight's SDK supports Python 3.7 - 3.11. + +## Install the library + +Make sure you have the latest version by running: + +``` +pip3 install groundlight --upgrade +``` + diff --git a/docs/docs/installation/raspberry-pi-jetson.md b/docs/docs/installation/raspberry-pi-jetson.md new file mode 100644 index 00000000..1874dc67 --- /dev/null +++ b/docs/docs/installation/raspberry-pi-jetson.md @@ -0,0 +1,20 @@ +# Raspberry Pi and NVIDIA Jetson + +Groundlight's SDK works great on ARM devices like Raspberry Pi and NVIDIA Jetson. + +``` +pip3 install groundlight +``` + +an ARM-compatible version will automatically get installed. + +## Streams + +If you have `docker` installed on your Pi, you can even just run + +``` +docker run groundlight/stream +``` + +as we publish an ARM version of our streaming application to dockerhub. + diff --git a/docs/docs/building-applications/installation-faqs.md b/docs/docs/installation/ubuntu-18.md similarity index 73% rename from docs/docs/building-applications/installation-faqs.md rename to docs/docs/installation/ubuntu-18.md index d75561f1..768f4cf5 100644 --- a/docs/docs/building-applications/installation-faqs.md +++ b/docs/docs/installation/ubuntu-18.md @@ -1,8 +1,6 @@ -# Instructions for common platforms +# Ubuntu 18.04 -### Ubuntu 18.04 - -Ubuntu 18.04 still uses python 3.6 by default, which is end-of-life. We recommend setting up python 3.8 as follows: +Ubuntu 18.04 still uses python 3.6 by default, which is end-of-life. We generally recommend using python 3.10. If you know how to install py3.10, please go ahead. But the easiest version of python 3 to use with Ubuntu 18.04 is python 3.8, which can be installed as follows: ```shell # Prepare Ubuntu to install things diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 664b10fa..5b7d2f19 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -8,11 +8,11 @@ const darkCodeTheme = require("prism-react-renderer/themes/vsDark"); /** @type {import('@docusaurus/types').Config} */ const config = { title: "Groundlight", - tagline: "Computer vision made simple", + tagline: "Computer Vision powered by Natural Language", favicon: "img/favicon.ico", // Set the production url of your site here - url: "https://groundlight.ai", + url: "https://www.groundlight.ai", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' baseUrl: "/python-sdk/", @@ -42,17 +42,12 @@ const config = { ({ docs: { sidebarPath: require.resolve("./sidebars.js"), - // Please change this to your repo. - // Remove this to remove the "edit this page" links. editUrl: - "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/", - }, - blog: { - showReadingTime: true, - // Please change this to your repo. - // Remove this to remove the "edit this page" links. - editUrl: - "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/", + // Remove this to remove the "edit this page" links. + "https://github.com/groundlight/python-sdk/tree/main/docs/", + // the first "docs" is the branch + // the second "docs" is the subdir within the repo + // there will be a third one for real URLs. :) }, theme: { customCss: require.resolve("./src/css/custom.css"), @@ -79,7 +74,7 @@ const config = { position: "left", label: "Docs", }, - { to: "/blog", label: "Blog", position: "left" }, + { to: "/docs/category/building-applications", label: "Applications", position: "left" }, { href: "https://github.com/groundlight/python-sdk", label: "GitHub", @@ -91,41 +86,61 @@ const config = { style: "dark", links: [ { - title: "Docs", + title: "Documentation", items: [ { label: "Getting Started", to: "/docs/getting-started", }, + { + label: "Building Applications", + to: "/docs/category/building-applications", + }, + { + label: "Installation", + to: "/docs/category/installation", + }, ], }, { - title: "Community", + title: "Company", items: [ { - label: "Twitter", - href: "https://twitter.com/GroundlightAI", + label: "About", + href: "https://www.groundlight.ai/", }, { - label: "Discord", - href: "https://discordapp.com/invite/groundlight", + label: "Team", + href: "https://www.groundlight.ai/team", }, { - label: "Stack Overflow", - href: "https://stackoverflow.com/questions/tagged/groundlight", + label: "Careers", + href: "https://www.groundlight.ai/careers", + }, + { + label: "Sign In", + href: "https://app.groundlight.ai/", }, ], }, { - title: "More", + title: "Code", items: [ { - label: "Blog", - to: "/blog", + label: "Github", + href: "https://github.com/groundlight/", + }, + { + label: "Python SDK", + href: "https://pypi.org/project/groundlight/", + }, + { + label: "Video streaming", + href: "https://github.com/groundlight/stream", }, { - label: "GitHub", - href: "https://github.com/groundlight/python-sdk", + label: "Arduino", + href: "https://github.com/groundlight/esp32cam", }, ], }, diff --git a/docs/src/components/HomepageFeatures/index.tsx b/docs/src/components/HomepageFeatures/index.tsx index 89a7e4df..d73119d4 100644 --- a/docs/src/components/HomepageFeatures/index.tsx +++ b/docs/src/components/HomepageFeatures/index.tsx @@ -1,53 +1,62 @@ import clsx from "clsx"; -import React from "react"; import styles from "./styles.module.css"; +// There should be a line here that says +// import React from "react"; +// VSCode might try to delete it, but that will break the site. +import React from "react"; type FeatureItem = { title: string; - Svg: React.ComponentType>; + imgsrc: string; description: JSX.Element; }; const FeatureList: FeatureItem[] = [ { - title: "Model Creation", - Svg: require("@site/static/img/undraw_docusaurus_mountain.svg").default, + title: "Instant Models", + imgsrc: "img/1-models.png", description: ( <> - Groundlight automatically builds a custom model for your application, - starting from our Visual Language Model (VLM) and your first query. No - need to even bring a data set. + Groundlight's Visual Large Language Model (VLLM) technology creates + computer vision models from English instructions instead of a dataset. + This reduces the time to get an AI-driven solution off the ground. + Did we mention you don't need a dataset? ), }, { - title: "Active Learning", - Svg: require("@site/static/img/undraw_docusaurus_tree.svg").default, + title: "Human Reliability", + + imgsrc: "img/2-reliability.png", description: ( <> - Realtime escalations handle edge cases so that your model can work - effectively from the first query. Groundlight constantly updates and - tunes. + Groundlight's models are allowed to say they're "Unsure" and can + escalate to a larger model or human expert for assistance. + By knowing what they know, Groundlight's models act more robust, + combining the speed of AI with the reliability of human oversight. ), }, { - title: "Invisible MLOps", - Svg: require("@site/static/img/undraw_docusaurus_react.svg").default, + title: "Seamless MLOps", + imgsrc: "img/3-mlops.png", description: ( <> - Groundlight continuously audits both labels and results to keep your - model up-to-date and always able to adapt to changes in the environment. + Because Groundlight starts with humans-in-the-loop (HITL), + continuous monitoring and auditing are automatic. + Any data drift is automatically detected and corrected for. + So you know your visual applications won't fall behind as the world + around them inevitably changes. ), }, ]; -function Feature({ title, Svg, description }: FeatureItem) { +function Feature({ title, imgsrc, description }: FeatureItem) { return (
- +

{title}

diff --git a/docs/src/pages/index.tsx b/docs/src/pages/index.tsx index 655f91a4..50ad85ba 100644 --- a/docs/src/pages/index.tsx +++ b/docs/src/pages/index.tsx @@ -3,6 +3,9 @@ import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; import HomepageFeatures from "@site/src/components/HomepageFeatures"; import Layout from "@theme/Layout"; import clsx from "clsx"; +// There should be a line here that says +// import React from "react"; +// VSCode might try to delete it, but that will break the site. import React from "react"; import styles from "./index.module.css"; @@ -31,8 +34,8 @@ export default function Home(): JSX.Element { const { siteConfig } = useDocusaurusContext(); return (
diff --git a/docs/static/img/1-models.png b/docs/static/img/1-models.png new file mode 100644 index 00000000..ada81827 Binary files /dev/null and b/docs/static/img/1-models.png differ diff --git a/docs/static/img/2-reliability.png b/docs/static/img/2-reliability.png new file mode 100644 index 00000000..bd89c417 Binary files /dev/null and b/docs/static/img/2-reliability.png differ diff --git a/docs/static/img/3-mlops.png b/docs/static/img/3-mlops.png new file mode 100644 index 00000000..6a5161a3 Binary files /dev/null and b/docs/static/img/3-mlops.png differ diff --git a/docs/static/img/undraw_docusaurus_mountain.svg b/docs/static/img/undraw_docusaurus_mountain.svg deleted file mode 100644 index af961c49..00000000 --- a/docs/static/img/undraw_docusaurus_mountain.svg +++ /dev/null @@ -1,171 +0,0 @@ - - Easy to Use - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/static/img/undraw_docusaurus_react.svg b/docs/static/img/undraw_docusaurus_react.svg deleted file mode 100644 index 94b5cf08..00000000 --- a/docs/static/img/undraw_docusaurus_react.svg +++ /dev/null @@ -1,170 +0,0 @@ - - Powered by React - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/static/img/undraw_docusaurus_tree.svg b/docs/static/img/undraw_docusaurus_tree.svg deleted file mode 100644 index d9161d33..00000000 --- a/docs/static/img/undraw_docusaurus_tree.svg +++ /dev/null @@ -1,40 +0,0 @@ - - Focus on What Matters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pyproject.toml b/pyproject.toml index 51ce2927..f2e0df51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "groundlight" -version = "0.7.2" +version = "0.7.3" license = "MIT" readme = "README.md" homepage = "https://www.groundlight.ai"