{"id":21191743,"url":"https://github.com/edgeimpulse/example-transform-dall-e-images","last_synced_at":"2025-07-10T03:31:05.459Z","repository":{"id":156110081,"uuid":"621710579","full_name":"edgeimpulse/example-transform-Dall-E-images","owner":"edgeimpulse","description":"Use the Dall-E API to generate an image dataset","archived":false,"fork":false,"pushed_at":"2024-06-27T09:51:34.000Z","size":2598,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-27T10:58:00.348Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edgeimpulse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-31T08:15:09.000Z","updated_at":"2024-06-27T09:51:37.000Z","dependencies_parsed_at":"2024-04-08T14:40:52.949Z","dependency_job_id":"21438282-8738-4bd0-b01c-68489d5ec83d","html_url":"https://github.com/edgeimpulse/example-transform-Dall-E-images","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fexample-transform-Dall-E-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fexample-transform-Dall-E-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fexample-transform-Dall-E-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fexample-transform-Dall-E-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edgeimpulse","download_url":"https://codeload.github.com/edgeimpulse/example-transform-Dall-E-images/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225615187,"owners_count":17496945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T19:04:46.320Z","updated_at":"2024-11-20T19:04:46.991Z","avatar_url":"https://github.com/edgeimpulse.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DALL-E 3 Image Generation Block for Edge Impulse\n\nThis is a transformation block that uses DALL-E 3 to generate synthetic data for your Edge Impulse project.\n\n## How to run (Edge Impulse)\n\n### Using the Synthetic Data feature (professional \u0026 enterprise)\n\nThe Studio now has a feature for interacting with Synthetic Data directly from the Studio; and the DALL-E 3 block is available there.\n\n1. Go to a Professional or Enterprise project, choose **Data acquisition \u003e Synthetic data**.\n2. Select the 'DALL-E 3 Synthetic Image Generator' block, fill in your prompt and label, and hit *Generate data*.\n\n    \u003e You currently need an OpenAI API Key, see https://platform.openai.com/docs/api-reference/authentication\n\n3. Your synthetic data will show on the right side, for quick evaluation of your prompt.\n\n![Synthetic Data](images/synthetic-data.png)\n\n### Customizing this repository (enterprise only)\n\nYou can modify this repository and push it as a new custom Synthetic Data transformation block.\n\n1. Install the [Edge Impulse CLI](https://docs.edgeimpulse.com/docs/tools/edge-impulse-cli).\n2. Open a command prompt or terminal, and navigate to this folder.\n3. Create a new transformation block:\n\n    ```\n    $ edge-impulse-blocks init\n\n    ? Choose a type of block: Transformation block\n    ? Choose an option: Create a new block\n    ? Enter the name of your block: Custom DALL-E Image Generator\n    ? Enter the description of your block: Use the DALL-E API to generate new images.\n    ? What type of data does this block operate on? Standalone (runs the container, but no files / data items passed in)\n    ? Which buckets do you want to mount into this block (will be mounted under /mnt/s3fs/BUCKET_NAME, you can change these mount points in the St\n    udio)?\n    ? Would you like to download and load the example repository? no\n    ```\n\n4. Push the block:\n\n    ```\n    $ edge-impulse-blocks push\n    ```\n\n5. To show this block in Synthetic Data:\n    1. Go to your Edge Impulse organization.\n    2. choose **Custom blocks \u003e Transformation**, find your new block, click the three dots, and select *Edit transformation block*.\n    3. Enable 'Show in Synthetic data':\n\n        ![Show in synthetic data](images/show-in-synthetic-data.png)\n\n    4. Save the block.\n\n6. You can now access your modified block from **Data acquisition \u003e Synthetic data** on any enterprise project.\n\n## How to run (locally)\n\n1. Install the dependencies:\n\n    ```\n    pip3 install -r requirements.txt\n    ```\n\n2. Run the generate script:\n\n    ```\n    OPENAI_API_KEY=sk-... EI_PROJECT_API_KEY=ei_034... python3 transform.py --prompt \"A photo of a factory worker wearing a hard hat\" --label \"hard_hat\" --images 3\n    ```\n\n    \u003e Replace `sk-...` with a valid [OpenAI API Key](https://platform.openai.com/docs/api-reference/authentication), and replace `ei_034...` with your Edge Impulse API Key (**Dashboard \u003e Keys**).\n\n3. Output is stored both in `output/` and uploaded to your Edge Impulse project.\n\n## --synthetic-data-job-id argument / x-synthetic-data-job-id header\n\nIf you want to build your own custom Synthetic Data block, you'll need to parse the (optional) `--synthetic-data-job-id` argument. When uploading data to the ingestion service you need to then pass the value from this argument to the `x-synthetic-data-job-id` header. [transform.py](transform.py) implements this. This is required so we know which job generated what data, and is used to render the UI on the Synthetic Data page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeimpulse%2Fexample-transform-dall-e-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgeimpulse%2Fexample-transform-dall-e-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeimpulse%2Fexample-transform-dall-e-images/lists"}