vnijs / awesome-chatgpt-code-interpreter-experiments

Awesome things you can do with ChatGPT + Code Interpreter combo πŸ”₯

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chatgpt πŸ’¬ + code interpreter πŸ’» experiments

πŸ‘‹ hello

We aim to push ChatGPT + Code Interpreter to its limits, show you what's possible and unlock your creativity! Well, and have a lot of fun doing it! πŸ”₯

πŸ’» code interpreter

Code Interpreter is an official ChatGPT plugin for data analytics, image conversions, editing code, and more. Since July 6th, 2023, it has been available to all ChatGPT Plus users. It provides OpenaAI models with a working Python interpreter in a sandboxed, firewalled execution environment. Importantly, it is possible to upload and download files.

πŸ‘‰ activate code interpreter
  1. Navigate to ChatGPT settings.

  2. Activate Code Interpreter in the "Beta features" tab.



  3. Select GPT-4 + Code Interpreter environment.

⚠️ limitations

  • No internet access.
  • You can upload a maximum of 100 MB. (*)
  • Runs only Python code. (*)
  • Does not allow installation of external Python packages. (*)
  • When the environment dies, you lose the entire state. Links that allowed you to download files stopped working.

(*) - it is possible to bypass these restrictions

⛓️ jailbreaks

Install external Python packages

Code Interpreter has a set of pre-installed Python packages. Since CI does not have access to the Internet, you cannot install packages from outside the environment. ChatGPT will also not allow you to install add-on packages via .whl files.

πŸ‘‰ steps
  1. Upload your .whl file and ask ChatGPT to install it.



  2. Ask nicely.



  3. Import your package.

Running Java Script app through Code Interpreter

Code Interpreter is an experimental ChatGPT plugin that can write Python to a Jupyter Notebook and execute it in a sandbox. This makes it impossible to execute code written in a language other than Python.

Deno is server-side JavaScript runtime that is packaged as a single binary.

πŸ‘‰ steps
  1. Upload compressed Deno binary and make it executable.



  2. Ask nicely.



  3. Write a hello world Deno program and execute it.



  4. Ask nicely once again.

πŸ§ͺ experiments

Detect and track face on the video

OpenAI does not allow access to pre-trained deep learning models in the Code Interpreter environment. However, it is still possible to detect and track objects. We just need to be more creative. Haar Cascade was one of the most popular approaches to face detection in old-school computer vision.

πŸ‘‰ steps
  1. Upload input video.

    πŸ‘‰ display input video
    IMG_5759.MOV
  2. Confirm that ChatGPT can successfully process the video. Extract the first frame and display it.



  3. Run Haar Cascade face detection on a single video frame.



  4. Run Haar Cascade face detection on the whole video.



    πŸ‘‰ display result video
    processed_video.mp4
  5. Use box IoU to remove false positives.



    πŸ‘‰ display result video
    processed_video_iou_single_box.mp4
  6. Crop video to follow the face.

processed_video_iou_single_box_crop_paste_600x600.mp4

Classification of images from the MNIST dataset

The MNIST dataset is a widely-used collection of handwritten digits that is used to teach computers how to recognize and understand numbers. It consists of thousands of examples of handwritten numbers from 0 to 9, created by different people in different styles. The images are very small - only 28x28 pixels. Therefore, they are great for training in an environment with limited resources.

πŸ‘‰ steps
  1. Upload the MNIST dataset into the Code Interpreter environment.

  2. only 10% of the original dataset is loaded to save hard drive and memory space.



  3. Make sure that Code Interpreter knows how to process data.



  4. Split data into train and test subsets.



  5. Train sci-kit learn Support Vector Classifier on the test set.



  6. Evaluate the trained model on the test set.



  7. Visualize false classification results.



  8. Download the trained model.

Detect, track, and count

OpenAI does not allow object detection models in the Code Interpreter environment. To carry out detection and tacking, we must take advantage of the unique colors of the objects we are interested in.

πŸ‘‰ steps
  1. Upload input video.

    πŸ‘‰ display input video
    ampules.mov
  2. Confirm that ChatGPT can successfully process the video. Extract the first frame and display it.



  3. Isolate light blue color objects.



  4. Draw boxes around the clusters of blue pixels.



  5. Filter out small clusters of blue pixels.



  6. Apply IoU-based tracking.

    πŸ‘‰ display result video
    ampules_with_tracking_iou.1.mp4
  7. Add object counting.



  8. Remove false detections.

Using OCR to extract text from images

🚧 coming soon...

🦸 contribution

We would love your help in making this repository even better! If you know of an amazing prompt you would like to share, or if you have any suggestions for improvement, feel free to open an issue or submit a pull request.

πŸ™ acknowledgments

About

Awesome things you can do with ChatGPT + Code Interpreter combo πŸ”₯