Mars 2023, we start noticing train cars. That is, when a train approaches, stop what you are doing, and just watch in silence until the train passes. This encourages presence.

While watching these cars, I started counting. These are long cargo trains, sometimes with double stacked containers. They come several times per hour in either direction.

alt name:: Train Otaku

Log

2024-02-29

https://youtu.be/gypJ9lG9fio Submitting film to BBIFF

brief description:

A shot of two trains passing just outside of Bombay Beach. The train, an embodiment of human progress and industry, stands in stark contrast to the natural tranquility of the desert landscape. By stopping to observe the train, to be present for its passing, we interrogate the contrast of rumbling train and vast desert.

Mistral:

At Bombay Beach in California’s Sonoran desert, two cargo trains pass by, their powerful engines interrupting the serene silence with a reminder of industry and technological advancement.

We pause to observe the contrast between the raw power of the trains and the natural beauty of the landscape, and observe the interplay between silence and noise, monotony and change, the past, present, and future.

Shot on February 4th, 2024 as part of a larger train observation project at Mars College.

2024-02-12

Filmed more trains.

  • upload train footage.
  • split train footage in to individual photos
  • add to Roboflow dataset

Use a solar panel + camera + meshtastic? Would be cool to get closer to the trains for higher res pics. Need auto exposure adjustment.

2024-02-11

Showed Nickl and Sophia - they agreed I was on the right path and should just train on a much larger dataset. Existing dataset is ~4 of my own images and ~50 of some random train dataset. I think I need to film these trains from many different angles/times of day. Aim for a dataset of around 100 images and see where we get.

2024-02-08

  • Following a tutorial to train v8. https://www.youtube.com/watch?v=gRAyOPjQ9_s
    • set up Conda to manage virtual environments. Seems to be what Apple recommends
    • https://developer.apple.com/metal/pytorch/ ensure pytorch is set up to use Metal Performance Shaders (MPS)
    • The tutorial shows how to set up a directory structure for training with YOLO, just need to create a data_custom.yaml file to point at correct directories.
    • Currently using yolo cli from homebrew - it tries to use a datasets directory in /opt/homebrew...
    • yolo task=detect mode=train epochs=10 data=data_custom.yaml imgsz=640
    • yolo task=detect mode=predict model=best-1-2024-02-08.pt show=True conf=0.5 source=../../python/train-10s.mp4
    • Did not work so great, as the data set is wayy to small.
    • Used an existing Train data set, though it did not work either on this clip. See result
      • yolo task=detect mode=predict model=/opt/homebrew/runs/detect/train18/weights/best.pt show=True conf=0.5 source=../../python/train-10s.mp4 this was trained on this dataset https://universe.roboflow.com/trainotaku/train-cars-emsdu/dataset/2
      • Maybe I can amend this data set with own images of these local trains - which I did. It contains only a few. Need way more!!!
      • this actually worked okay on the full frame video

MVP [Done]

How can I complete this in one hour?

  • Film a few trains
  • Davinci resolve project, create square video of train moving across Train Layer Video

Goal: Automate car counting

Tech

OpenCV (python) on the backend, JavaScript for scripting, some webview

Constraints

Daylight hours, using solar (this is offgrid), using high quality camera.

Pipeline

A camera hooked up to a computer should be recording footage. The footage should only be kept if a train passes. Analyze footage using OpenCV - count cars, count containers, count engines, identify cars with Graffiti, identify Containers from same company, identify empty cars, identify cars with non-container cargo. Extract photo of each car, and piece together in to panorama (perhaps with width constraint to make a square photo).

Things to notice

  • count cars
  • count containers
  • count engines
  • identify cars with Graffiti
  • identify Containers from same company
  • identify empty cars
  • identify cars with non-container cargo.

Outputs

  • Panoramic images
  • Panoramic video
  • Discord Bot on Mars Server (Eden)
  • Webpage to document all of these things.

Research

This project uses motion detection https://thezanshow.com/electronics-tutorials/raspberry-pi/project-cookie-thief

Use ImageAI https://github.com/OlafenwaMoses/ImageAI/

ImageAI

This uses PyTorch beneath and is a layer on top.

  • 2024-02-06 I got this running, and there is a ‘train’ label, though it did not detect any trains when I ran the 10s video through it.

Label Studio

Open Source data labeling https://labelstud.io/blog/quickly-create-datasets-for-training-yolo-object-detection-with-label-studio/

Track and Count Objects using YOLOv8 ByteTrack and Supervision

https://docs.ultralytics.com/guides/object-counting/#real-world-applications https://blog.roboflow.com/yolov8-tracking-and-counting/#counting-objects-with-supervision https://www.youtube.com/watch?v=OS5qI9YBkfk

How to Train for Object Detection on a Custom Dataset