# fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance architecture

> Architecture diagram of the GitHub repository fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance
- Repository: https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance

## Overview

This repository implements language-conditioned 6-DoF grasp detection for cluttered point clouds. The principal workflow loads point-cloud scenes and positive/negative prompts, trains a diffusion denoiser with noise and negative-prompt losses, generates grasp poses from a scene and text prompt, then evaluates saved predictions. The model combines PointNet++ scene features, text embeddings, grasp-pose and timestep embeddings, and negative-prompt guidance. The README also documents training, generation, and evaluation; robot experiments and visualization are present in the tree. Some peripheral source was not sampled, so uncertain runtime links are omitted.

Main entry points: [`generate.py`](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/generate.py) (Grasp generation), [`models/utils.py`](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/utils.py) (Encoders and schedule), [`models/denoiser.py`](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/denoiser.py) (Diffusion denoiser), [`utils/trainer.py`](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/utils/trainer.py) (Training loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data"]
  node_dataset["Grasp dataset<br/>[Grasp6DDataset.py]"]
  node_train_data["Training examples<br/>[Grasp6DDataset.py]"]
  node_test_data["Test examples<br/>[Grasp6DDataset.py]"]
end

subgraph group_model["Diffusion model"]
  node_denoiser["Diffusion denoiser<br/>[denoiser.py]"]
  node_noise_predictor["Noise predictor<br/>[noise_predictor.py]"]
  node_pointnet["PointNet++ layers<br/>[pointnet_utils.py]"]
  node_model_utils["Encoders and schedule<br/>[utils.py]"]
  node_text_service["OpenCLIP encoder"]
end

subgraph group_learning["Training"]
  node_config["Model config<br/>[Denoiser.py]"]
  node_builder["Builders<br/>[builder.py]"]
  node_trainer["Training loop<br/>[trainer.py]"]
  node_loss["Training losses<br/>[loss.py]"]
end

subgraph group_inference["Inference and evaluation"]
  node_generator["Grasp generation<br/>[generate.py]"]
  node_predictions["Saved predictions<br/>[generate.py]"]
  node_evaluator["Evaluation<br/>[eval.py]"]
  node_eval_utils["Evaluation helpers<br/>[test_utils.py]"]
  node_visualizer["Visualization<br/>[visualize.py]"]
  node_robot_exp["Robot experiment<br/>[robot_exp.py]"]
end

node_user(("Researcher"))

node_user -->|"configures"| node_config
node_user -->|"starts training"| node_trainer
node_user -->|"requests grasps"| node_generator
node_user -->|"evaluates results"| node_evaluator
node_dataset -->|"loads training split"| node_train_data
node_dataset -->|"loads test split"| node_test_data
node_builder -->|"builds training set"| node_dataset
node_builder -->|"builds model"| node_denoiser
node_trainer -->|"trains"| node_denoiser
node_trainer -->|"encodes prompts"| node_model_utils
node_trainer -->|"computes losses"| node_loss
node_denoiser -->|"predicts noise"| node_noise_predictor
node_denoiser -->|"uses schedule"| node_model_utils
node_noise_predictor -->|"uses encoders"| node_model_utils
node_model_utils -->|"uses abstractions"| node_pointnet
node_model_utils -->|"encodes text"| node_text_service
node_generator -->|"loads test set"| node_dataset
node_generator -->|"builds model"| node_builder
node_generator -->|"encodes prompt"| node_model_utils
node_generator -->|"generates grasps"| node_denoiser
node_generator -->|"saves results"| node_predictions
node_evaluator -->|"reads results"| node_predictions
node_evaluator -->|"uses helpers"| node_eval_utils

click node_dataset "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/dataset/Grasp6DDataset.py"
click node_train_data "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/dataset/Grasp6DDataset.py"
click node_test_data "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/dataset/Grasp6DDataset.py"
click node_config "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/config/Denoiser.py"
click node_builder "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/utils/builder.py"
click node_trainer "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/utils/trainer.py"
click node_denoiser "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/denoiser.py"
click node_noise_predictor "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/noise_predictor.py"
click node_pointnet "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/pointnet_utils.py"
click node_model_utils "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/utils.py"
click node_loss "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/loss.py"
click node_generator "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/generate.py"
click node_predictions "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/generate.py"
click node_evaluator "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/eval.py"
click node_eval_utils "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/utils/test_utils.py"
click node_visualizer "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/visualize.py"
click node_robot_exp "https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/robot_exp.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dataset,node_train_data,node_test_data toneBlue
class node_denoiser,node_noise_predictor,node_pointnet,node_model_utils,node_text_service toneAmber
class node_config,node_builder,node_trainer,node_loss toneMint
class node_generator,node_predictions,node_evaluator,node_eval_utils,node_visualizer,node_robot_exp toneRose
class node_user toneIndigo
```

## Components

### Data

- [Grasp dataset](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/dataset/Grasp6DDataset.py): `dataset/Grasp6DDataset.py`
- [Training examples](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/dataset/Grasp6DDataset.py): `dataset/Grasp6DDataset.py`
- [Test examples](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/dataset/Grasp6DDataset.py): `dataset/Grasp6DDataset.py`

### Diffusion model

- [Diffusion denoiser](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/denoiser.py): `models/denoiser.py`
- [Noise predictor](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/noise_predictor.py): `models/noise_predictor.py`
- [PointNet++ layers](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/pointnet_utils.py): `models/pointnet_utils.py`
- [Encoders and schedule](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/utils.py): `models/utils.py`
- **OpenCLIP encoder**

### Training

- [Model config](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/config/Denoiser.py): `config/Denoiser.py`
- [Builders](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/utils/builder.py): `utils/builder.py`
- [Training loop](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/utils/trainer.py): `utils/trainer.py`
- [Training losses](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/models/loss.py): `models/loss.py`

### Inference and evaluation

- [Grasp generation](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/generate.py): `generate.py`
- [Saved predictions](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/generate.py): `generate.py`
- [Evaluation](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/eval.py): `eval.py`
- [Evaluation helpers](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/utils/test_utils.py): `utils/test_utils.py`
- [Visualization](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/visualize.py): `visualize.py`
- [Robot experiment](https://github.com/fsoft-aic/language-driven-6-dof-grasp-detection-using-negative-prompt-guidance/blob/main/robot_exp.py): `robot_exp.py`

### Other components

- **Researcher**

## Connections

- Researcher → Model config: configures (evidence: `README.md`)
- Researcher → Training loop: starts training (evidence: `README.md`)
- Researcher → Grasp generation: requests grasps (evidence: `README.md`)
- Researcher → Evaluation: evaluates results (evidence: `README.md`)
- Grasp dataset → Training examples: loads training split (evidence: `dataset/Grasp6DDataset.py`)
- Grasp dataset → Test examples: loads test split (evidence: `dataset/Grasp6DDataset.py`)
- Builders → Grasp dataset: builds training set (evidence: `utils/builder.py`)
- Builders → Diffusion denoiser: builds model (evidence: `utils/builder.py`)
- Training loop → Diffusion denoiser: trains (evidence: `utils/trainer.py`)
- Training loop → Encoders and schedule: encodes prompts (evidence: `utils/trainer.py`)
- Training loop → Training losses: computes losses (evidence: `utils/trainer.py`)
- Diffusion denoiser → Noise predictor: predicts noise (evidence: `models/denoiser.py`)
- Diffusion denoiser → Encoders and schedule: uses schedule (evidence: `models/denoiser.py`)
- Noise predictor → Encoders and schedule: uses encoders (evidence: `models/noise_predictor.py`)
- Encoders and schedule → PointNet++ layers: uses abstractions (evidence: `models/utils.py`)
- Encoders and schedule → OpenCLIP encoder: encodes text (evidence: `models/utils.py`)
- Grasp generation → Grasp dataset: loads test set (evidence: `generate.py`)
- Grasp generation → Builders: builds model (evidence: `README.md`)
- Grasp generation → Encoders and schedule: encodes prompt (evidence: `generate.py`)
- Grasp generation → Diffusion denoiser: generates grasps (evidence: `generate.py`)
- Grasp generation → Saved predictions: saves results (evidence: `generate.py`)
- Evaluation → Saved predictions: reads results (evidence: `README.md`)
- Evaluation → Evaluation helpers: uses helpers (evidence: `eval.py`)
