# Project export: Jetsam

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: TreeHacks 2026
- Tagline: An aquatic trash collecting robot made from trash
- Devpost: https://devpost.com/software/jetsam
- GitHub: https://github.com/AsilahMJ/jetsam
- Video: https://www.youtube.com/embed/cj2AptDQIf4?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 0 GitHub contributor(s) — 

## Devpost submission (written by the team)

### Inspiration

Ghost fishing gear makes up 10% of litter and 46% of the Great Pacific Garbage Patch. At the same time, only 23% of PET plastics like single-use water bottles of the 60 million used daily are recycled. Plastic litter can tangle animals, pollute waterways, and damages ecosystems. Jetsam uses a dual-pronged approach to detect and collect both PET plastics and fishing nets. Made from recycled materials, including both the fishing nets and plastic water bottles, it embodies a cradle-to-cradle framework. The fishing nets will be recycled into various items in collaboration with local businesses. The PET collected can be converted into BAETA, a carbon absorbing substrate that reduces the emissions of recycling fishing nets. A small portion of plastics acquired will be turned into more Jetsams.

### What it does

Jetsam records where trash is found, how much is detected, what type it is, along with GPS location and time. Over time, this creates a pollution density map to identify hotspots and support smarter environmental planning. It also includes wildlife-aware avoidance, automatically stopping collection when animals are detected. Actions are confidence-based: if TensorFlow detection confidence is above 50%, the system proceeds; if below 50%, it re-evaluates using OpenAI and Claude to prevent false decisions. It skims the surfaces of waterways, scooping up plastic, particularly PET and fishing nets. Jetsam is also fully electric, powered by a propeller motor.

### How we built it

Jetsam is built from various waste produced by TreeHacks around Huang. We collected single-use plastic water bottles, specifically those not placed in recycling, so the landfill and compost bins. We constructed a catamaran raft-like structure that relies on plastic bottles for buoyancy. Using netting from fruit packaging, we created a chamber that traps trash, but lets water currents flow through. Using servo motors and an arduino, we powered a 3D printed propeller pulley system. We added a raspberry pi and camera that detects and identifies objects.

### Challenges we ran into

Too many to count. We could not connect the camera with the raspberry pi despite A LOT of troubleshooting. We also struggled with acquiring all the necessary hardware parts to create multiple motors. As a result, Jetsam P1 has only one propeller, which is enough to move it slowly.

### Accomplishments we're proud of

We’re proud to have made Jetsam completely out of found materials from around the hackathon. It forced us to adapt along the way, think creatively and resourcefully, and adjust our concept. We’re also super happy that Jetsam floats as intended and can genuinely catch trash.

### What we learned

We learned how to combine hardware and software, working collaboratively across disciplines. In our research, we learned about various existing trash collection robots and how seriously fishing nets contribute to pollution. Finally, by attending workshops and speaking with mentors, we learned to hone in on our niche and pain-point to develop a complete business/product system.

### What's next

In the next prototype, Jetsam will be fully autonomous, with more precise maneuvering. It will also have solar panels to recharge the electrical battery. We will incorporate swarm intelligence so Jetsams can move in a unit to target trash hotspots.

## README (from the GitHub repository)

No README available.

## Detected evidence (automated analysis)

Indexed codebase: 1 recognized source files, 2 KB.
- Python (language) — detected in the code
- C++ (language) — claimed on Devpost, not found in the code
- TensorFlow (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (4 of 4)

```
labels.txt
model.tflite
sketch_feb14a/sketch_feb14a.ino
trash_detector.py
```

### Dependencies

No dependency index available.

### Recent commits (newest first)

- Pushing arduino code for servo from desktop.
- Adding model training files from desktop.

## Key source files (fetched from GitHub, selected and truncated for size)

### trash_detector.py

```python
import cv2
import numpy as np
from datetime import datetime

try:
    import tflite_runtime.interpreter as tflite
except:
    import tensorflow.lite as tflite

interpreter = tflite.Interpreter(model_path="model.tflite")
interpreter.allocate_tensors()

input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()

with open('labels.txt', 'r') as f:
    labels = [line.strip().split(' ', 1)[1] for line in f.readlines()]

print(f"Model loaded! Classes: {labels}\n")

def detect_trash(frame):
    img = cv2.resize(frame, (224, 224))
    img = np.expand_dims(img, axis=0)
    img = (img.astype(np.float32) / 127.5) - 1
    
    interpreter.set_tensor(input_details[0]['index'], img)
    interpreter.invoke()
    
    output_data = interpreter.get_tensor(output_details[0]['index'])
    
    # Show ALL predictions
    return output_data[0], labels

def main():
    cap = cv2.VideoCapture(0)
    print("🎓 Custom AI Trash Detection")
    print("Showing all predictions... Press 'q' to quit\n")
    
    while True:
        ret, frame = cap.read()
        if not ret:
            break
        
        predictions, label_names = detect_trash(frame)
        
        # Find top prediction
        class_index = np.argmax(predictions)
        top_class = label_names[class_index]
        top_confidence = predictions[class_index]
        
        # Display top prediction
        color = (0, 255, 0) if top_confidence > 0.5 else (0, 165, 255)
        cv2.putText(frame, f"{top_class}", (20, 50), 
                    cv2.FONT_HERSHEY_SIMPLEX, 1.2, color, 3)
        cv2.putText(frame, f"{top_confidence*100:.1f}%", (20, 100), 
                    cv2.FONT_HERSHEY_SIMPLEX, 0.8, color, 2)
        
        # Show all predictions on the side
        y_pos = 150
        cv2.putText(frame, "All predictions:", (20, y_pos), 
                    cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)
        y_pos += 25
        
        for i, (label, conf) in enumerate(zip(label_names, predictions)):
            cv2.putText(frame, f"{label}: {conf*100:.0f}%", (20, y_pos), 
                        cv2.FONT_HERSHEY_SIMPLEX, 0.4, (255, 255, 255), 1)
            y_pos += 20
        
        cv2.imshow('Trash Detection', frame)
        
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    
    cap.release()
    cv2.destroyAllWindows()

if __name__ == "__main__":
    main()
```