Skip to content

fix(imports):resolve detection startup command in README#132

Open
Prarthana124 wants to merge 1 commit into
Devnil434:mainfrom
Prarthana124:fix/detection-module-import
Open

fix(imports):resolve detection startup command in README#132
Prarthana124 wants to merge 1 commit into
Devnil434:mainfrom
Prarthana124:fix/detection-module-import

Conversation

@Prarthana124
Copy link
Copy Markdown
Contributor

@Prarthana124 Prarthana124 commented May 28, 2026

This PR updates the README detection startup command to use module-style execution instead of direct script execution.

Problem

The previous command:

python services/detection/detection.py --source data/sample_videos/sample.mp4

caused import resolution issues during startup, resulting in errors such as:

ModuleNotFoundError: No module named 'libs.schemas'

and related package import failures.

Solution

Updated the README command to:

python -m services.detection.detection --source data/sample_videos/sample.mp4

This ensures Python resolves project packages correctly during startup.

Testing

  • Verified on Windows 11
  • Tested with Python 3.13
  • Confirmed module import errors are resolved with module-style execution

This PR only updates documentation and does not modify application logic.

Summary by CodeRabbit

  • Documentation
    • Updated the sample command in the README to use Python module invocation style for running detection on sample videos, replacing the direct script file path approach.

Review Change Stack

Fixes #129

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

The README's sample video detection command is updated to use Python module invocation (python -m services.detection.detection) instead of direct script path execution, aligning with standard Python packaging conventions.

Changes

README Documentation Update

Layer / File(s) Summary
Detection command documentation
README.md
Sample video detection run command now uses Python module invocation style (python -m services.detection.detection --source ...) instead of direct script path execution.

Possibly related issues

  • #129: Directly addresses the Python import-resolution issue that prompted the switch to python -m module invocation in the README example.

Poem

🐰 A simple hop through docs so bright,
Module paths now set just right,
No more scripts that stumble and fall,
Python's standard way wins all! ✨


🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title mentions 'resolve detection startup command in README' which accurately reflects the main change of updating the README's detection command. The title is specific and descriptive about what was modified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

268-281: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify the working directory for the detection command.

After step 4 (line 268), the user is in the services/detection directory, but the command at line 281 requires execution from the project root. The python -m services.detection.detection syntax expects the services package to be importable from the current working directory.

Add an explicit instruction to return to the project root before step 6, or note the required working directory in the command example.

📝 Suggested fix
 ### 6. Run detection on a sample video
 
+From the project root directory:
+
 ```bash
 python -m services.detection.detection --source data/sample_videos/sample.mp4

Or alternatively, add a step to return to root:

```diff
 ### 5. Pull the VLM model (local inference)
 
 ```bash
 ollama pull llava:latest

+### 6. Return to project root
+
+bash +cd ../.. +
+
-### 6. Run detection on a sample video
+### 7. Run detection on a sample video


</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @README.md around lines 268 - 281, The README's step to run detection uses
"python -m services.detection.detection" which requires running from the project
root (so the services package is importable); update the docs to either (A) add
an explicit step after pulling the model that returns the user to the project
root (e.g., "cd ../..") and renumber the following step, or (B) change the
example run command to a path-relative invocation that works from
services/detection (e.g., run the module directly without -m) — reference the
exact string "python -m services.detection.detection" and the surrounding steps
(pull llava:latest and Run detection on a sample video) when making the change.


</details>

</blockquote></details>

</blockquote></details>
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@README.md`:
- Around line 268-281: The README's step to run detection uses "python -m
services.detection.detection" which requires running from the project root (so
the services package is importable); update the docs to either (A) add an
explicit step after pulling the model that returns the user to the project root
(e.g., "cd ../..") and renumber the following step, or (B) change the example
run command to a path-relative invocation that works from services/detection
(e.g., run the module directly without -m) — reference the exact string "python
-m services.detection.detection" and the surrounding steps (pull llava:latest
and Run detection on a sample video) when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5d9e94ff-0e0d-43a4-88e3-1ca67b6689c2

📥 Commits

Reviewing files that changed from the base of the PR and between 3c9175c and 678b888.

📒 Files selected for processing (1)
  • README.md

@Prarthana124
Copy link
Copy Markdown
Contributor Author

Prarthana124 commented May 28, 2026

Hi @Devnil434, the failing Phase 3 and Phase 4 checks appear to be related to existing repository workflow/test configuration issues and are unrelated to this documentation-only change.

This PR only updates the README detection startup command to use module-style execution:

python -m services.detection.detection --source data/sample_videos/sample.mp4

I verified locally on Windows 11 + Python 3.13 that the previous command caused import-related startup failures, while the updated command resolves the package import issue correctly.

No application logic or workflow configuration was modified in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Detection pipeline fails with ModuleNotFoundError for libs.schemas

1 participant