Skip to content

Commit

Permalink
removed needless comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryogrid committed Oct 24, 2024
1 parent cff9b37 commit c664571
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions colab_env/tagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from typing import List, Tuple, Dict, Any, Optional, Callable, Protocol

import numpy as np
from humanfriendly.terminal import output
from numpy import signedinteger
from PIL import Image
import timm
Expand Down Expand Up @@ -158,15 +157,9 @@ def predict(
for img in images:
img_tmp = self.prepare_image(img)
# run the model's input transform to convert to tensor and rescale
# input: Tensor = self.transform(img_tmp).unsqueeze(0)
input: Tensor = self.transform(img_tmp)
# NCHW image RGB to BGR
# input = input[:, [2, 1, 0]]
input = input[[2, 1, 0]]
# if inputs is None:
# inputs = input
# else:
# inputs = torch.cat((inputs, input), 0)
inputs.append(input)
batched_tensor = torch.stack(inputs, dim=0)

Expand All @@ -188,8 +181,6 @@ def predict(
print("Processing results...")
preds = outputs.numpy()

# print(preds)
# exit(1)
ret_strings: List[str] = []
for idx in range(0, len(images)):
labels: List[Tuple[str, float]] = list(zip(self.tag_names, preds[idx].astype(float)))
Expand Down

0 comments on commit c664571

Please sign in to comment.