Open-source atomic malware analysis

Analyze another

zhicao/dreamzero main

PYTHON
Verdict: BENIGN
Mal-ecule
H₂(Db₂Os)
Size 6.5 KB download
First seen 17 days ago
Analyzed 1 day ago
Ecosystem huggingface
image_utils.py python
1 """
2 Visualizations
3 """
4
5 from __future__ import annotations
6
7 import os
8 import time
9 from typing import Literal
10 import warnings
11
12 import cv2
13 import imageio
14 import matplotlib.pyplot as plt
15 import numpy as np Imports the NumPy array library
16 import torch
17
18 from .array_tensor_utils import any_describe
19 from .misc_utils import global_once
20 from .torch_utils import t
27:6 in "auto" mode, we assume C == 3
28 """
29 assert channel_order in ["hwc", "chw", "auto"]
30 if torch.is_tensor(img):
31 img = img.cpu().numpy()
32 assert isinstance(img, np.ndarray) Module built on the numeric Python stack
33 if img.ndim == 4:
34 assert img.shape[0] == 1
35 img = img[0]
36 assert img.ndim == 3
37 if channel_order == "auto":
38 # use C==3 to detect order
39 if img.shape[0] == 3
40:13 channel_order = "chw"
41 else:
42 assert img.shape[-1] == 3, "image should either have [3,H,W] or [H,W,3]"
43 channel_order = "hwc"
44 img = img.astype(np.uint8)
45 if channel_order == "chw":
52:27 g))
53
54
55 def imsave(img, path):
56 imageio.imsave(os.path.expanduser(path), to_image(img))
57
58
59 def imread(path, channel_order="chw", format="torch"): Raster image loader call
60 assert channel_order in ["hwc", "chw"]
61 assert format in ["numpy", "torch"]
62 img = imageio.imread(path)
63 if channel_order == "chw":
64 img = np.transpose(img, (
126:20 h
127
128 # prevent segfault in IsaacGym
129 display_var = os.environ.get("DISPLAY", None) Python reads an environment variable
130 if not display_var:
131 os.environ["DISPLAY"] = ":0.0"
132
133 if torch.is_tensor(img):
134 img = img.detach().cpu().numpy()
135
136

Micro-behaviors

Metadata

Identity

SHA-256 31e10392dfd2fa518ae75c7e76a30eb1e2caf072ea7a16b354def46fa82d78b0
Filename image_utils.py
Package zhicao/dreamzero
Version main
PURL pkg:huggingface/zhicao/dreamzero@main

Origin

Source forager
Feed huggingface.co
Ecosystem huggingface
Domain huggingface.co
URL https://huggingface.co/zhicao/dreamzero

Timeline

First seen 13 Aug 2026 21:18 UTC
First analyzed 30 Aug 2026 18:08 UTC
Last analyzed 30 Aug 2026 18:08 UTC
Last updated 30 Aug 2026 18:08 UTC

Labeling

Label unknown
Label source forager
Traits version cdf4f