# Technical documentation — object_detection_py

Evidence date: 2026-10-08. Revision: `main` `b53f138d4862071f4d3a9cef071c49da0a232168` (2024-03-26). Remote: `https://bitbucket.org/overdrive/object_detection_py.git`.

## Architecture

A single git repository with three tracked paths and no runtime of its own. The readme assumes a developer workstation where conda, pip, `protoc`, and LabelImg are installed, and where the TensorFlow Object Detection API has been checked out so that `research/object_detection` exists.

```text
object_detection_py/          this repository, main @ b53f138
├── .gitignore                stock Bitbucket template, commit 3eaa9eb
├── readme.md                 operator notes, commits 0d91c62 and b53f138
└── tf2/
    └── models                gitlink 505c718, no .gitmodules
```

There is no process model, no network listener, and no package entry point in this tree.

## Languages and frameworks

| Item | Evidence | Provenance |
|---|---|---|
| Python 3.9 | `conda create -n {name} python=3.9` and `conda install python=3.9` in `readme.md` | Documented |
| conda | Those same lines, plus `conda activate` and `conda install numpy` | Documented |
| pip | `python -m pip install .`, `pip install wget`, `pip install labelimg` | Documented |
| Protocol Buffers compiler | Argument `protoc` to `use_protobuff.py` | Documented. Compiler version **Unknown** |
| TensorFlow 2 Object Detection API | Directory name `tf2`, command `model_main_tf2.py`, path `research/object_detection` | **Inferred** from names. TensorFlow is not imported anywhere in this repo because there is no Python file |
| LabelImg | `pip install labelimg`, `labelimg.exe` | Documented |

No `requirements.txt`, `Pipfile`, `pyproject.toml`, `setup.py`, `setup.cfg`, `environment.yml`, or `Dockerfile`.

## Application structure

### Tracked files

`.gitignore` is the unmodified Bitbucket example (header comment links to `https://www.atlassian.com/git/tutorials/saving-changes/gitignore`). It ignores `node_modules/`, `dist/`, `*.class`, `*.py[cod]`, `*.log`, `*.jar`, Maven `target/`, `.idea/`, `TEST*.xml`, `.DS_Store`, `Thumbs.db`, `*.app`, `*.exe`, `*.war`, and several video/TIFF extensions. It does not ignore `*.jpg`, `*.png`, `*.xml`, `*.record`, or `*.pb`.

`readme.md` is 33 lines, no trailing newline, no Markdown title. Section markers are runs of asterisks (`*** create new environment`, `**** activate protobuff`, `*** do setup`, `*** test`, `*** model create`). Spelling in the notes: `protobuff`.

### Gitlink

```text
160000 commit 505c718df51d3c7d5f667d9acb0d6c1e34daa552  tf2/models
```

Recorded in commit `c496ae6` (2024-03-22, Dirk, "add files"). There is no `.gitmodules`, no submodule URL, and no branch pointer. `git clone` creates an empty `tf2/models` directory. `git submodule update` has nothing to read.

External check on 2026-10-08: that SHA is commit `505c718` on `github.com/tensorflow/models`, dated 2024-03-15, author tensorflower-gardener, message body PiperOrigin-RevId 616269325, changing `official/nlp/modeling/layers/__init__.py`. The commit date is seven days before Dirk recorded the gitlink.

At that same SHA, these paths exist:

- `research/object_detection/`
- `research/object_detection/model_main_tf2.py`
- `research/object_detection/builders/model_builder_tf2_test.py`
- `research/object_detection/data/mscoco_label_map.pbtxt`

These paths return 404 there:

- `research/object_detection/use_protobuff.py`
- `research/object_detection/detect_from_image.py`
- `research/object_detection/xml_to_csv.py`
- `research/object_detection/generate_tfrecord.py`

This inspection did not vendor or read the upstream tree beyond those path checks. The URL is **Inferred**. The SHA is **Implemented** in the gitlink.

## HTTP API

None.

## Background work

None. No queue, cron, worker, or scheduler file.

## Integrations

| Integration | How it appears | Data exchanged | Auth |
|---|---|---|---|
| conda / pip | Local commands in `readme.md` | Packages onto the workstation | None in repo |
| `protoc` | Passed as an argument to `use_protobuff.py` | Compiled protos, destination **Unknown** | None |
| LabelImg | `pip install labelimg`, `labelimg.exe` | Images in, annotations out. Format **Unknown** except the following script name implies XML | None |
| `tensorflow/models` @ `505c718` | Gitlink only | Object Detection API sources if someone checks that commit out by hand | Public GitHub commit. URL not stored here |
| Saved model directory | CLI `-m` path | Weights read by `detect_from_image.py` | None in repo. Weights not in git |
| Python package `wget` | `pip install wget` | Download target **Unknown** | None |

The model directory name `ssd_mobilenet_v2_320x320_coco17_tpu-8` matches a TensorFlow 2 Detection Model Zoo id. The readme does not include the zoo URL. Provenance of the match: **Inferred** from the string.

## Auth

No application auth. No tokens, passwords, or `.env` files are in git. Bitbucket access control for the repo is **Unknown** from the source tree.

## Storage

Git stores the readme, the ignore file, and a 20-byte gitlink. It does not store:

- model weights
- pipeline configs
- images or XML/CSV labels
- TFRecords
- the upstream models checkout

Local paths named by the readme, none of which are in git:

| Path | Role |
|---|---|
| `ssd_mobilenet_v2_320x320_coco17_tpu-8\saved_model` | Inference saved model |
| `.\data\mscoco_label_map.pbtxt` | Label map argument |
| `.\images` | Inference image directory |
| `images/test`, `images/train` | Commented TFRecord inputs |
| `images/test_labels.csv`, `images/train_labels.csv` | Commented CSV inputs |
| `test.record`, `train.record` | Commented TFRecord outputs |
| `ssd_efficientdet_d0_512x512_coco17_tpu-8.config` | Commented pipeline config |
| `training` | Commented `--model_dir` |

## Environments and deployment

One environment is described: a named conda env on the machine where the commands are typed. No dev/test/prod split, no host name, no container, no serverless config, no infrastructure-as-code.

Windows is suggested by backslash paths (`.\detect_from_image.py`, `\saved_model`) and `labelimg.exe`. Provenance: **Inferred**.

No Bitbucket Pipelines file, no GitHub Actions, no Sonar project file in git.

**Discrepancy:** the 2026-09-28 onboarding scan listed `sonar-project.properties` and `sonarqube_scan.bat` on the scan host. They are not in any commit. Provenance: **Unknown**.

## Security notes (observed, not a pentest)

- No secrets were found in the four commits.
- `.gitignore` does not ignore `.env`, `*.record`, or image files. Nothing sensitive of those types is committed. A later add of datasets or checkpoints would not be blocked by the current ignore rules, except where an extension matches the media list (`*.tiff` and the video extensions) or `*.exe`.
- The gitlink points at a third-party commit without pinning a URL or a signature. Confirm the remote before populating `tf2/models`.
- `python -m pip install .` installs whatever directory is current. The readme does not pin a hash.

## Development and testing

Documented test command, after `cd research/object_detection`:

```text
python builders/model_builder_tf2_test.py
```

That file is part of the upstream Object Detection API at the pinned SHA. This repository does not run it. There is no PHPUnit, pytest config, tox, nox, or pipeline.

How to reproduce the tree that was read:

```text
git clone https://bitbucket.org/overdrive/object_detection_py.git
git checkout b53f138
```

That clone will not fill `tf2/models`. To inspect the inferred upstream pin:

```text
git clone https://github.com/tensorflow/models.git
git checkout 505c718df51d3c7d5f667d9acb0d6c1e34daa552
```

Do that only after a human confirms the URL. It is not recorded in `.gitmodules`.

## Monitoring

None in git. No metrics, logs, or health checks.

## File map for the next reader

| Question | Where to look |
|---|---|
| What is this repo for? | `readme.md` |
| Which upstream commit was pinned? | `git ls-tree HEAD tf2/models` → `505c718df51d3c7d5f667d9acb0d6c1e34daa552` |
| Why is `tf2/models` empty? | No `.gitmodules` |
| What changed last? | `b53f138` rewrote the commented training line |
| Where are the detectors and scripts? | Not in this repository. See the PRD discrepancies |
| Is there a Sonar project in git? | No |
