# StateShift

- **Event:** [Gemini 3 Paris Hackathon](https://cerebralvalley.ai/e/gemini-3-paris-hackathon)
- **When:** Sat, Mar 14 at 9:00 AM – 10:00 PM (GMT+1)
- **Where:** Location TBA
- **Placement:** Finalist
- **Team:** [Ciprian Bangu](https://cerebralvalley.ai/u/CEBangu)
- **GitHub:** https://github.com/CEBangu/state-shift
- **Demo video:** https://youtu.be/lx4S5JzoQag
- **Gallery:** https://cerebralvalley.ai/e/gemini-3-paris-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/gemini-3-paris-hackathon/hackathon/gallery/13

StateShift efficiently finds semantic events in long videos using Gemini and classic search algorithms. A user uploads a video and asks a natural-language query like “Find when the bottle gets knocked over” or “Find when the door opens.” Instead of scanning every frame, the system first compares the semantic state at the start and end of the video. If they differ, it performs a binary search to localize the transition. If not, it uses exponential search (1, 2, 4, 8, …) to discover a likely bracket before refining with binary search. In the common single-transition case, this reduces Gemini calls from linear to near-logarithmic growth, often cutting model usage by 99%+ on long videos. This reduction makes using Gemini for these sorts of tasks a complete no-brainer, rather than a potentially expensive solution. It also expands the possible videos that can be analyzed beyond what can be handled by simple CV models. Two demo videos are included; see the README for setup and usage.

---

Markdown version of https://cerebralvalley.ai/e/gemini-3-paris-hackathon/hackathon/gallery/13. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
