Skip to content

Commit

Permalink
Feature/update (#19)
Browse files Browse the repository at this point in the history
* pillow update

* pre-commit hook adjusted

* README adjusted

* adjustment of pre-commit hook

* formatting
  • Loading branch information
matsch845 authored Jan 29, 2024
1 parent b6eb7b9 commit ac8b91f
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
rev: v1.4.1
hooks:
- id: mypy
args: ["--exclude=\"((?:logs|datasets|output|frames_detected|model_weights|venv|yolov[0-9]))\"", "--ignore-missing-imports"]
args: ["--exclude=\"((?:logs|datasets|output|PixelFormer|frames_detected|model_weights|venv|yolov[0-9]))\"", "--ignore-missing-imports"]

- repo: local
hooks:
Expand All @@ -29,4 +29,5 @@ repos:
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
- id: pydocstyle
args: ["--ignore-self-only-init", "--ignore=D100,D104,D213,D203,D404", "--match-dir=\"^(?:(?!logs|datasets|output|PixelFormer|frames_detected|model_weights|notebooks|venv|yolov[0-9]).)*$\""]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Running the code can be done in two ways:
9. Download the YoloV4 weights from here: https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights
10. Place the weights in that folder: `speed_estimation/model_weights/`
11. Update the paths in `speed_estimation/paths.py` (detailed information in Section Configuration).
12. Activate the pre-commit hook: `pre-commit install` (the hook will then be installed in this directory `.git/hooks/pre-commit`)

### Docker Setup

Expand Down
Empty file removed __init__.py
Empty file.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dependencies:
- packaging==23.0
- pandas==1.5.2
- pathspec==0.11.1
- pillow==10.0.1
- pillow==10.2.0
- platformdirs==3.8.0
- plotly==5.13.0
- pre-commit==3.3.3
Expand Down
2 changes: 1 addition & 1 deletion environment_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dependencies:
- packaging==23.0
- pandas==1.5.2
- pathspec==0.11.1
- pillow==10.0.1
- pillow==10.2.0
- platformdirs==3.8.0
- plotly==5.13.0
- pre-commit==3.3.3
Expand Down
1 change: 1 addition & 0 deletions speed_estimation/get_fps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
should be analyzed.
This module will only be used if the FPS are not defined in speed_estimation/config.ini
"""

import time

import cv2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ def __init__(self, variance_focus):

def forward(self, depth_est, depth_gt, mask):
d = torch.log(depth_est[mask]) - torch.log(depth_gt[mask])
return (
torch.sqrt((d**2).mean() - self.variance_focus * (d.mean() ** 2)) * 10.0
)
return torch.sqrt((d**2).mean() - self.variance_focus * (d.mean() ** 2)) * 10.0


def flip_lr(image):
Expand Down
1 change: 1 addition & 0 deletions speed_estimation/modules/streaming/stream_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
NOTE: This module is work in progress and not integrated into the speed estimation pipeline yet.
"""

import argparse
import math
import subprocess as sp
Expand Down
1 change: 1 addition & 0 deletions speed_estimation/speed_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
6. As soon as the calibration is done, do the speed estimation based on the scaling factor and the
detected bounding boxes for the vehicles.
"""

import argparse
import configparser
import json
Expand Down
1 change: 1 addition & 0 deletions speed_estimation/utils/speed_estimation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The utility functions and classes for the speed estimation pipeline."""

from dataclasses import dataclass
from enum import Enum
from typing import List
Expand Down

0 comments on commit ac8b91f

Please sign in to comment.