# thotapallyanuraag/grasping architecture

> Architecture diagram of the GitHub repository thotapallyanuraag/grasping, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thotapallyanuraag/grasping
- Repository: https://github.com/thotapallyanuraag/grasping

## Overview

##### Project type and purpose
- This is an open-source machine-learning pipeline for predicting antipodal robotic grasps using a lightweight, fully-convolutional network (GGCNN).
- Its core function is to take raw Cornell Grasping Dataset PCDs, convert them to depth images, train/evaluate a CNN that outputs grasp quality and pose maps, and save checkpoints.

##### File structure
- Top level:
- Grasping.ipynb – experiment notebook
- preprocessing & utility scripts (preprocess.py, preprocess_fixed.py, checking.py, checknan.py)
- train_ggcnn.py / eval_ggcnn.py – orchestration of train and eval loops
- requirements.txt / README.md / LICENSE
- Directories:
- models/ – model definitions (common building blocks, GGCNN variants)
- utils/data/ – dataset-specific loaders (Cornell, Jacquard)
- utils/dataset_processing/ – data conversion, grasp generation, evaluation
- utils/visualisation/ – result plotting (gridshow)
- output/models/ – model checkpoint artifacts and metrics logs

##### README for additional insights
- Confirms the use of Cornell Grasping Dataset
- Describes data conversion step (PCD → depth) and where trained models land
- Indicates lightweight, fast, closed-loop deployment intent

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "1. Raw Data Storage"
        RawData["Cornell PCDs"]:::data
    end

    subgraph "2. Data Processing"
        Depth["Depth Generation"]:::preprocess
        GraspMap["Grasp Map Generation"]:::preprocess
    end

    subgraph "3. Data Loader"
        CornellLoader["Cornell Dataset Loader"]:::dataloader
        GenericLoader["Generic Grasp Dataset Utilities"]:::dataloader
        JacquardLoader["Jacquard Dataset Loader"]:::dataloader
    end

    subgraph "4. Model Definition"
        Common["Common Layers/Utils"]:::model
        GGCNN1["GGCNN Architecture v1"]:::model
        GGCNN2["GGCNN Architecture v2"]:::model
    end

    subgraph "5. Pipelines"
        subgraph "Training Pipeline"
            Train["train_ggcnn.py"]:::orchestrator
        end
        subgraph "Evaluation Pipeline"
            Eval["eval_ggcnn.py"]:::orchestrator
            Metrics["Evaluation Metrics"]:::preprocess
        end
    end

    subgraph "6. Output Artifact Store"
        OutputModels["Checkpoints & Logs"]:::output
    end

    subgraph "7. Visualization"
        Notebook["Grasping.ipynb"]:::viz
        Gridshow["gridshow.py"]:::viz
    end

    RawData --> Depth
    Depth --> GraspMap
    GraspMap --> CornellLoader
    GraspMap --> GenericLoader
    GraspMap --> JacquardLoader

    CornellLoader --> Train
    GenericLoader --> Train
    JacquardLoader --> Train
    Common --> Train
    GGCNN1 --> Train
    GGCNN2 --> Train

    Train --> OutputModels
    OutputModels --> Eval
    Eval --> Metrics
    Eval --> Notebook
    Metrics --> Notebook
    OutputModels --> Notebook
    Notebook --> Gridshow

    click Depth "https://github.com/thotapallyanuraag/grasping/blob/main/utils/dataset_processing/generate_cornell_depth.py"
    click GraspMap "https://github.com/thotapallyanuraag/grasping/blob/main/utils/dataset_processing/generate_cornell_grasps.py"
    click CornellLoader "https://github.com/thotapallyanuraag/grasping/blob/main/utils/data/cornell_data.py"
    click GenericLoader "https://github.com/thotapallyanuraag/grasping/blob/main/utils/data/grasp_data.py"
    click JacquardLoader "https://github.com/thotapallyanuraag/grasping/blob/main/utils/data/jacquard_data.py"
    click Common "https://github.com/thotapallyanuraag/grasping/blob/main/models/common.py"
    click GGCNN1 "https://github.com/thotapallyanuraag/grasping/blob/main/models/ggcnn.py"
    click GGCNN2 "https://github.com/thotapallyanuraag/grasping/blob/main/models/ggcnn2.py"
    click Train "https://github.com/thotapallyanuraag/grasping/blob/main/train_ggcnn.py"
    click Eval "https://github.com/thotapallyanuraag/grasping/blob/main/eval_ggcnn.py"
    click Metrics "https://github.com/thotapallyanuraag/grasping/blob/main/utils/dataset_processing/evaluation.py"
    click Gridshow "https://github.com/thotapallyanuraag/grasping/blob/main/utils/visualisation/gridshow.py"
    click Notebook "https://github.com/thotapallyanuraag/grasping/blob/main/Grasping.ipynb"
    click OutputModels "https://github.com/thotapallyanuraag/grasping/tree/main/output/models/"

    classDef data fill:#ADD8E6,stroke:#000,color:#000
    classDef preprocess fill:#FFA500,stroke:#000,color:#000
    classDef dataloader fill:#90EE90,stroke:#000,color:#000
    classDef model fill:#98FB98,stroke:#000,color:#000
    classDef orchestrator fill:#FFFF00,stroke:#000,color:#000
    classDef output fill:#D3D3D3,stroke:#000,color:#000
    classDef viz fill:#D8BFD8,stroke:#000,color:#000
```
