Skip to content

ShangChienLiu/GritAndGPT4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


GRITANDGPT4

β—¦ Power up your AI with GritAndGPT4!

β—¦ Developed with the software and tools below.

GNU%20Bash tqdm JavaScript Prettier scikitlearn YAML Jest C ESLint Python TypeScript Docker Docker GitHub%20Actions GitHub JSON Markdown

license repo-language-count repo-top-language last-commit


πŸ”— Quick Links


πŸ“ Overview

GritAndGPT4 is a project designed to harness the capabilities of the GRIT (Generative Region-to-Text Transformer for Object Understanding) model to capture object descriptions. These descriptions are then processed by GPT-4, which generates safety suggestions to enhance driver awareness.


πŸ“‚ Repository Structure

└── GritAndGPT4/
    β”œβ”€β”€ LICENSE 2
    β”œβ”€β”€ configs/
    β”‚   β”œβ”€β”€ Base.yaml
    β”‚   β”œβ”€β”€ GRiT_B_DenseCap.yaml
    β”‚   β”œβ”€β”€ GRiT_B_DenseCap_ObjectDet.yaml
    β”‚   β”œβ”€β”€ GRiT_B_ObjectDet.yaml
    β”‚   β”œβ”€β”€ GRiT_H_ObjectDet.yaml
    β”‚   └── GRiT_L_ObjectDet.yaml
    β”œβ”€β”€ datasets/
    β”œβ”€β”€ demo.py
    β”œβ”€β”€ demo_images/
    β”œβ”€β”€ detectron2/
    β”‚   β”œβ”€β”€ .circleci/
    β”‚   β”‚   β”œβ”€β”€ config.yml
    β”‚   β”‚   └── import-tests.sh
    β”‚   β”œβ”€β”€ .clang-format
    β”‚   β”œβ”€β”€ configs/
    β”‚   β”‚   β”œβ”€β”€ Base-RCNN-C4.yaml
    β”‚   β”‚   β”œβ”€β”€ Base-RCNN-DilatedC5.yaml
    β”‚   β”‚   β”œβ”€β”€ Base-RCNN-FPN.yaml
    β”‚   β”‚   β”œβ”€β”€ Base-RetinaNet.yaml
    β”‚   β”‚   β”œβ”€β”€ COCO-Detection/
    β”‚   β”‚   β”œβ”€β”€ COCO-InstanceSegmentation/
    β”‚   β”‚   β”œβ”€β”€ COCO-Keypoints/
    β”‚   β”‚   β”œβ”€β”€ COCO-PanopticSegmentation/
    β”‚   β”‚   β”œβ”€β”€ Cityscapes/
    β”‚   β”‚   β”œβ”€β”€ Detectron1-Comparisons/
    β”‚   β”‚   β”œβ”€β”€ LVISv0.5-InstanceSegmentation/
    β”‚   β”‚   β”œβ”€β”€ LVISv1-InstanceSegmentation/
    β”‚   β”‚   β”œβ”€β”€ Misc/
    β”‚   β”‚   β”œβ”€β”€ PascalVOC-Detection/
    β”‚   β”‚   β”œβ”€β”€ common/
    β”‚   β”‚   β”œβ”€β”€ new_baselines/
    β”‚   β”‚   └── quick_schedules/
    β”‚   β”œβ”€β”€ datasets/
    β”‚   β”‚   β”œβ”€β”€ prepare_ade20k_sem_seg.py
    β”‚   β”‚   β”œβ”€β”€ prepare_cocofied_lvis.py
    β”‚   β”‚   β”œβ”€β”€ prepare_for_tests.sh
    β”‚   β”‚   └── prepare_panoptic_fpn.py
    β”‚   β”œβ”€β”€ demo/
    β”‚   β”‚   β”œβ”€β”€ demo.py
    β”‚   β”‚   └── predictor.py
    β”‚   β”œβ”€β”€ detectron2/
    β”‚   β”‚   β”œβ”€β”€ checkpoint/
    β”‚   β”‚   β”œβ”€β”€ config/
    β”‚   β”‚   β”œβ”€β”€ engine/
    β”‚   β”‚   β”œβ”€β”€ evaluation/
    β”‚   β”‚   β”œβ”€β”€ export/
    β”‚   β”‚   β”œβ”€β”€ layers/
    β”‚   β”‚   β”œβ”€β”€ model_zoo/
    β”‚   β”‚   β”œβ”€β”€ modeling/
    β”‚   β”‚   β”œβ”€β”€ projects/
    β”‚   β”‚   β”œβ”€β”€ solver/
    β”‚   β”‚   β”œβ”€β”€ structures/
    β”‚   β”‚   β”œβ”€β”€ tracking/
    β”‚   β”‚   └── utils/
    β”‚   β”œβ”€β”€ dev/
    β”‚   β”‚   β”œβ”€β”€ linter.sh
    β”‚   β”‚   β”œβ”€β”€ packaging/
    β”‚   β”‚   β”œβ”€β”€ parse_results.sh
    β”‚   β”‚   β”œβ”€β”€ run_inference_tests.sh
    β”‚   β”‚   └── run_instant_tests.sh
    β”‚   β”œβ”€β”€ docker/
    β”‚   β”‚   β”œβ”€β”€ Dockerfile
    β”‚   β”‚   β”œβ”€β”€ deploy.Dockerfile
    β”‚   β”‚   └── docker-compose.yml
    β”‚   β”œβ”€β”€ projects/
    β”‚   β”‚   β”œβ”€β”€ DeepLab/
    β”‚   β”‚   β”œβ”€β”€ DensePose/
    β”‚   β”‚   β”œβ”€β”€ Panoptic-DeepLab/
    β”‚   β”‚   β”œβ”€β”€ PointRend/
    β”‚   β”‚   β”œβ”€β”€ PointSup/
    β”‚   β”‚   β”œβ”€β”€ Rethinking-BatchNorm/
    β”‚   β”‚   β”œβ”€β”€ TensorMask/
    β”‚   β”‚   └── TridentNet/
    β”‚   β”œβ”€β”€ setup.py
    β”œβ”€β”€ grit/
    β”‚   β”œβ”€β”€ config.py
    β”‚   β”œβ”€β”€ custom_solver.py
    β”‚   β”œβ”€β”€ evaluation/
    β”‚   β”‚   └── eval.py
    β”‚   β”œβ”€β”€ modeling/
    β”‚   β”‚   β”œβ”€β”€ backbone/
    β”‚   β”‚   β”œβ”€β”€ meta_arch/
    β”‚   β”‚   β”œβ”€β”€ roi_heads/
    β”‚   β”‚   β”œβ”€β”€ soft_nms.py
    β”‚   β”‚   └── text/
    β”‚   └── predictor.py
    β”œβ”€β”€ ks_demo_predictions/
    β”‚   β”œβ”€β”€ 0046.txt
    β”‚   β”œβ”€β”€ 0046_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0117.txt
    β”‚   β”œβ”€β”€ 0117_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0158.txt
    β”‚   β”œβ”€β”€ 0158_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0226.txt
    β”‚   β”œβ”€β”€ 0226_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0309.txt
    β”‚   β”œβ”€β”€ 0309_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0334.txt
    β”‚   β”œβ”€β”€ 0334_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0422.txt
    β”‚   β”œβ”€β”€ 0422_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0518.txt
    β”‚   β”œβ”€β”€ 0518_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0623.txt
    β”‚   β”œβ”€β”€ 0623_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0638.txt
    β”‚   β”œβ”€β”€ 0638_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0803.txt
    β”‚   β”œβ”€β”€ 0803_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 0831.txt
    β”‚   └── 0831_gpt-4_out.txt
    β”œβ”€β”€ ks_demo_safety/
    β”œβ”€β”€ ks_demo_visualizations/
    β”œβ”€β”€ lauch_deepspeed.py
    β”œβ”€β”€ node_modules/
    β”‚   └── yaml/
    β”‚       β”œβ”€β”€ browser/
    β”‚       β”œβ”€β”€ package.json
    β”‚       └── util.js
    β”œβ”€β”€ predictions/
    β”‚   β”œβ”€β”€ 1.txt
    β”‚   β”œβ”€β”€ 1_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 2.txt
    β”‚   β”œβ”€β”€ 2_gpt-4_out.txt
    β”‚   β”œβ”€β”€ 85building.txt
    β”‚   β”œβ”€β”€ 85building_gpt-4_out.txt
    β”‚   β”œβ”€β”€ KS000455.txt
    β”‚   β”œβ”€β”€ KS000455_gpt-4_out.txt
    β”‚   β”œβ”€β”€ KS002508.txt
    β”‚   β”œβ”€β”€ KS002508_gpt-4_out.txt
    β”‚   β”œβ”€β”€ KS003229.txt
    β”‚   β”œβ”€β”€ KS003229_gpt-4_out.txt
    β”‚   β”œβ”€β”€ Kaohsiung_highschool_N.txt
    β”‚   β”œβ”€β”€ Kaohsiung_highschool_N_gpt-4_out.txt
    β”‚   β”œβ”€β”€ Kaohsiung_port.txt
    β”‚   β”œβ”€β”€ Kaohsiung_port_gpt-4_out.txt
    β”‚   β”œβ”€β”€ beef.txt
    β”‚   β”œβ”€β”€ beef_gpt-4_out.txt
    β”‚   β”œβ”€β”€ black_hole.txt
    β”‚   β”œβ”€β”€ black_hole_gpt-4_out.txt
    β”‚   β”œβ”€β”€ crowded traffic.txt
    β”‚   β”œβ”€β”€ crowded traffic_gpt-4_out.txt
    β”‚   β”œβ”€β”€ dock.txt
    β”‚   β”œβ”€β”€ dock_gpt-4_out.txt
    β”‚   β”œβ”€β”€ dog.txt
    β”‚   β”œβ”€β”€ dog_gpt-4_out.txt
    β”‚   β”œβ”€β”€ door.txt
    β”‚   β”œβ”€β”€ door_gpt-4_out.txt
    β”‚   β”œβ”€β”€ game.txt
    β”‚   β”œβ”€β”€ game_gpt-4_out.txt
    β”‚   β”œβ”€β”€ giant_brick.txt
    β”‚   β”œβ”€β”€ giant_brick_gpt-4_out.txt
    β”‚   β”œβ”€β”€ kaohsiung_engaging.txt
    β”‚   β”œβ”€β”€ kaohsiung_engaging_gpt-4_out.txt
    β”‚   β”œβ”€β”€ new_scence.txt
    β”‚   β”œβ”€β”€ new_scence_gpt-4_out.txt
    β”‚   β”œβ”€β”€ ntu_door.txt
    β”‚   β”œβ”€β”€ ntu_door_gpt-4_out.txt
    β”‚   β”œβ”€β”€ police car.txt
    β”‚   β”œβ”€β”€ police car_gpt-4_out.txt
    β”‚   β”œβ”€β”€ police car_man.txt
    β”‚   β”œβ”€β”€ police car_man_gpt-4_out.txt
    β”‚   β”œβ”€β”€ police.txt
    β”‚   β”œβ”€β”€ police_gpt-4_out.txt
    β”‚   β”œβ”€β”€ rocket.txt
    β”‚   β”œβ”€β”€ rocket1.txt
    β”‚   β”œβ”€β”€ rocket1_gpt-4_out.txt
    β”‚   β”œβ”€β”€ rocket_gpt-4_out.txt
    β”‚   β”œβ”€β”€ science_building.txt
    β”‚   β”œβ”€β”€ science_building2.txt
    β”‚   β”œβ”€β”€ science_building2_gpt-4_out.txt
    β”‚   β”œβ”€β”€ science_building3.txt
    β”‚   β”œβ”€β”€ science_building3_gpt-4_out.txt
    β”‚   β”œβ”€β”€ science_building_gpt-4_out.txt
    β”‚   β”œβ”€β”€ space1.txt
    β”‚   β”œβ”€β”€ space1_gpt-4_out.txt
    β”‚   β”œβ”€β”€ stone.txt
    β”‚   β”œβ”€β”€ stone_gpt-4_out.txt
    β”‚   β”œβ”€β”€ strange_window_building.txt
    β”‚   β”œβ”€β”€ strange_window_building2.txt
    β”‚   β”œβ”€β”€ strange_window_building2_gpt-4_out.txt
    β”‚   β”œβ”€β”€ strange_window_building_gpt-4_out.txt
    β”‚   β”œβ”€β”€ student.txt
    β”‚   β”œβ”€β”€ student_gpt-4_out.txt
    β”‚   β”œβ”€β”€ temple.txt
    β”‚   β”œβ”€β”€ temple2.txt
    β”‚   β”œβ”€β”€ temple2_gpt-4_out.txt
    β”‚   β”œβ”€β”€ temple_gpt-4_out.txt
    β”‚   β”œβ”€β”€ test.txt
    β”‚   β”œβ”€β”€ test2.txt
    β”‚   β”œβ”€β”€ test2_gpt-4_out.txt
    β”‚   β”œβ”€β”€ test3.txt
    β”‚   β”œβ”€β”€ test3_gpt-4_out.txt
    β”‚   β”œβ”€β”€ test_gpt-4_out.txt
    β”‚   β”œβ”€β”€ trip.txt
    β”‚   β”œβ”€β”€ trip_gpt-4_out.txt
    β”‚   β”œβ”€β”€ zoo.txt
    β”‚   └── zoo_gpt-4_out.txt
    β”œβ”€β”€ requirements.txt
    β”œβ”€β”€ third_party/
    β”‚   └── CenterNet2/
    β”‚       β”œβ”€β”€ .circleci/
    β”‚       β”œβ”€β”€ .clang-format
    β”‚       β”œβ”€β”€ .github/
    β”‚       β”œβ”€β”€ configs/
    β”‚       β”œβ”€β”€ datasets/
    β”‚       β”œβ”€β”€ demo/
    β”‚       β”œβ”€β”€ detectron2/
    β”‚       β”œβ”€β”€ dev/
    β”‚       β”œβ”€β”€ docker/
    β”‚       β”œβ”€β”€ projects/
    β”‚       β”œβ”€β”€ setup.py
    β”œβ”€β”€ train_deepspeed.py
    β”œβ”€β”€ train_net.py
    β”œβ”€β”€ visualizations/
    └── ζŒ‡δ»€.txt

πŸš€ Getting Started

βš™οΈ Installation

  1. Clone the GritAndGPT4 repository:
git clone https://github.com/kennysuper007/GritAndGPT4
  1. Change to the project directory:
cd GritAndGPT4
  1. Install the dependencies:
pip install -r requirements.txt

πŸ€– Running GritAndGPT4

Use the following command to run GritAndGPT4:

python demo.py --test-task DenseCap --config-file configs/GRiT_B_DenseCap_ObjectDet.yaml --input demo_images --output visualizations --output_preds predictions --LLM gpt-4 --opts MODEL.WEIGHTS models/grit_b_densecap_objectdet.pth

🀝 Contributing

Contributions are welcome! Here are several ways you can contribute:

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your GitHub account.
  2. Clone Locally: Clone the forked repository to your local machine using a Git client.
    git clone <your-forked-repo-url>
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear and concise message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to GitHub: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.

Once your PR is reviewed and approved, it will be merged into the main branch.


πŸ“„ License

This project is protected under the MIT License. For more details, refer to the LICENSE file.


πŸ‘ Acknowledgments

  • I modified the GPT-4 prompt to improve the quality and safety of the suggestions based on Kinan's code.

About

Utilize Grit and GPT4 model to generate alert content from image

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published