Skip to content

Commit

Permalink
feat: scale based off of how much vram we use
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrutchf committed Nov 10, 2024
1 parent d3a360a commit 23177f5
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions fishsense_lite/commands/calibrate_laser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import cv2
import numpy as np
import ray
import fishsense_common.ray as ray
import torch
from fishsense_common.pluggable_cli import Command, argument
from pyfishsensedev.calibration import LaserCalibration, LensCalibration
Expand All @@ -16,7 +16,7 @@
from fishsense_lite.utils import uint16_2_uint8


@ray.remote(num_gpus=0.25)
@ray.remote(vram_mb=1536)
def execute(
input_file: Path,
lens_calibration: LensCalibration,
Expand Down
4 changes: 2 additions & 2 deletions fishsense_lite/commands/calibrate_lens.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from pathlib import Path
from typing import List, Tuple

import fishsense_common.ray as ray
import numpy as np
import ray
from fishsense_common.pluggable_cli import Command, argument
from pyfishsensedev.calibration import LensCalibration
from pyfishsensedev.image.image_processors import RawProcessor
Expand All @@ -12,7 +12,7 @@
from fishsense_lite.utils import uint16_2_uint8


@ray.remote(num_gpus=0.1)
@ray.remote(vram_mb=615)
def execute(
input_file: Path, rows: int, columns: int, square_size: float
) -> Tuple[np.ndarray | None, np.ndarray | None, int | None, int | None] | None:
Expand Down
4 changes: 2 additions & 2 deletions fishsense_lite/commands/field_calibrate_laser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import cv2
import matplotlib.pyplot as plt
import numpy as np
import ray
import fishsense_common.ray as ray
import torch
from fishsense_common.pluggable_cli import Command, argument
from pyfishsensedev.calibration import LaserCalibration, LensCalibration
Expand All @@ -19,7 +19,7 @@
from fishsense_lite.utils import uint16_2_uint8


@ray.remote(num_gpus=0.25)
@ray.remote(vram_mb=1536)
def execute(
input_file: Path,
lens_calibration: LensCalibration,
Expand Down
5 changes: 3 additions & 2 deletions fishsense_lite/commands/label_studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from typing import List, Tuple

import cv2
import fishsense_common.ray as ray
import numpy as np
import ray
import torch
from fishsense_common.pluggable_cli import Command, argument
from pyfishsensedev.calibration import LaserCalibration, LensCalibration
Expand Down Expand Up @@ -69,7 +69,7 @@ def __init__(
)


@ray.remote(num_gpus=0.25)
@ray.remote(vram_mb=1536)
def execute_laser(
input_file: Path,
lens_calibration: LensCalibration,
Expand Down Expand Up @@ -194,6 +194,7 @@ def output_path(self, value: str):
@property
@argument(
"--prefix",
default="",
help="The prefix to add to the output json file.",
)
def prefix(self) -> str:
Expand Down
5 changes: 2 additions & 3 deletions fishsense_lite/commands/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
from typing import List

import cv2
import numpy as np
import ray
import fishsense_common.ray as ray
from fishsense_common.pluggable_cli import Command, argument
from pyfishsensedev.calibration import LensCalibration
from pyfishsensedev.image import ImageRectifier, RawProcessor

from fishsense_lite.utils import get_output_file, get_root, uint16_2_uint8


@ray.remote(num_gpus=0.1)
@ray.remote(vram_mb=615)
def execute(
input_file: Path,
disable_histogram_equalization: bool,
Expand Down
4 changes: 2 additions & 2 deletions fishsense_lite/commands/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from typing import List, Tuple

import cv2
import fishsense_common.ray as ray
import numpy as np
import ray
import torch
from fishsense_common.pluggable_cli import Command, argument
from pyfishsensedev.calibration import LaserCalibration, LensCalibration
Expand All @@ -21,7 +21,7 @@
from fishsense_lite.utils import uint16_2_uint8


@ray.remote(num_gpus=0.25)
@ray.remote(vram_mb=1536)
def execute(
input_file: Path,
lens_calibration: LensCalibration,
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 23177f5

Please sign in to comment.