Get empowered by the Slavic god Svetovid, whose four heads represent omniscience - the ability to see through space and time in all directions at once. With his power, you can maintain a unified perspective across your tensors, models, and massive datasets. Peer into the architecture of your neural networks and navigate high-dimensional data with absolute clarity.
array_inspector.py
NumPy Inspector
Visualize any NumPy array with instant dimension awareness. Support for high-dimensional, large arrays.
data = np.random.rand(2, 4, 32, 32).astype(np.float32)
SvetoViz.array_web(data, gap_size=10)
Learn More
pytorch_debugger.py
PyTorch Debugger
Directly load your PyTorch module, interact, and debug activations in real-time.
img = Image.open("sample_image.jpg").convert("RGB")
img_np = np.array(img).astype(np.float32) / 255.0
# Rearrange from (H, W, C) to (C, H, W) and add batch dim
input_tensor = torch.from_numpy(img_np).permute(2, 0, 1).unsqueeze(0)
# 2. Define the 2D Convolutional module
conv2d = nn.Conv2d(in_channels=3, out_channels=16, kernel_size=3, stride=1, padding=1)
def terminal_callback(buffer, message, images, files):
# 3. Process the image through the module
output = conv2d(input_tensor)
# Log the feature map shape to the SvetoViz terminal
buffer.send_system_message(f"Processed image. Shape: {list(output.shape)}")
# 4. Start the interactive session
SvetoViz.pytorch(module=conv2d, terminal_callback=terminal_callback)
Learn More
model_viewer.py
Model Analysis
Deep-dive into model architecture. Explore layers down to a single parameter.
image_processor = DetrImageProcessor.from_pretrained(
"facebook/detr-resnet-50",
revision="no_timm",
device_map="cpu")
model = DetrForObjectDetection.from_pretrained(
"facebook/detr-resnet-50",
revision="no_timm",
device_map="cpu")
SvetoViz.model_web(
model=model,
image_processor=image_processor
)
Learn More
model_debug.py
Model Debugger
Interact with your model and investigate activations in real-time.
tokenizer = GPT2Tokenizer.from_pretrained('gpt2', device_map="cpu")
model = GPT2LMHeadModel.from_pretrained('gpt2', device_map="cpu")
def terminal_callback(buffer, message, images, files):
text = message # "Replace me by any text you'd like."
buffer.send_user_message(text)
inputs = tokenizer(text, return_tensors="pt")
# Generate continuation
outputs = model.generate(**inputs, max_new_tokens=50)
# Decode to string
decoded = tokenizer.decode(outputs[0], skip_special_tokens=True)
buffer.send_system_message(decoded)
SvetoViz.model_web(
model=model,
tokenizer=tokenizer,
terminal_callback=terminal_callback
)
Learn More
dataset_handler.py
Dataset Explorer
Efficiently stream and visualize large-scale HuggingFace datasets from local storage or remote server.
hf_name = "eltorio/ROCOv2-radiology"
dataset = load_dataset(hf_name, split="train")
layout = DatasetLayout(
name=hf_name,
dataset=dataset,
image_columns=["image"],
cell_size=(400, 400),
)
SvetoViz.save_to_disc(view=layout,
threaded=True,
directory=f"/Volumes/Untitled/{hf_name}",
compression=CompressionMode.PNG_0,
tree_db_only=False
)
SvetoViz.load_from_disc_web(directory=f"/Volumes/Untitled/{hf_name}")
Learn More
image_browser.py
Image Browser
Browse through massive collections of images regardless of resolution.
layout = DirectoryPackedSpiralLayout(
directory="/Users/piotrgryko/Desktop/nasaimages"
)
SvetoViz.save_to_disc(view=layout,
threaded=True,
directory="/Volumes/Untitled/universe",
compression=CompressionMode.JPEG_0)
SvetoViz.load_from_disc_web(directory="/Volumes/Untitled/universe")
Learn More