MCPcopy Index your code
hub / github.com/InternScience/SpectrumLab

github.com/InternScience/SpectrumLab @v0.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.2 ↗ · + Follow
207 symbols 1,198 edges 57 files 52 documented · 25%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SpectrumLab

A pioneering unified platform designed to systematize and accelerate deep learning research in spectroscopy.

🚀 Quick Start

Environment Setup

We recommend using conda and uv for environment management:

# Clone the repository
git clone https://github.com/little1d/SpectrumLab.git
cd SpectrumLab

# Create conda environment
conda create -n spectrumlab python=3.10
conda activate spectrumlab

pip install uv
uv pip install -e .

Data Setup

Download benchmark data from Hugging Face:

Extract the data to the data directory in the project root.

API Keys Configuration

# Copy and edit environment configuration
cp .env.example .env
# Configure your API keys in the .env file

💻 Usage

Python API

from spectrumlab.benchmark import get_benchmark_group
from spectrumlab.models import GPT4o
from spectrumlab.evaluator import get_evaluator

# Load benchmark data
benchmark = get_benchmark_group("perception")
data = benchmark.get_data_by_subcategories("all")

# Initialize model
model = GPT4o()

# Get evaluator
evaluator = get_evaluator("perception")

# Run evaluation
results = evaluator.evaluate(
    data_items=data,
    model=model,
    save_path="./results"
)

print(f"Overall accuracy: {results['metrics']['overall']['accuracy']:.2f}%")

Command Line Interface

The CLI provides a simple way to run evaluations:

# Basic evaluation
spectrumlab eval --model gpt4o --level perception

# Specify data path and output directory
spectrumlab eval --model claude --level signal --data-path ./data --output ./my_results

# Evaluate specific subcategories
spectrumlab eval --model deepseek --level semantic --subcategories "IR_spectroscopy" "Raman_spectroscopy"

# Customize output length
spectrumlab eval --model internvl --level generation --max-length 1024

# Get help
spectrumlab eval --help

🤝 Contributing

We welcome community contributions! Please see CONTRIBUTING.md for detailed guidelines.

Acknowledgments

  • Experiment Tracking: SwanLab for experiment management and visualization
  • Choice Evaluator Framework: Inspired by MMAR

Core symbols most depended-on inside this repo

get_data_by_subcategories
called by 37
spectrumlab/benchmark/base.py
evaluate
called by 19
spectrumlab/evaluator/base.py
encode_image_to_base64
called by 18
spectrumlab/utils/image_utils.py
evaluate_many
called by 17
spectrumlab/evaluator/base.py
_format_accuracy
called by 11
leaderboard/gradio/app.py
prepare_images_for_prompt
called by 5
spectrumlab/utils/image_utils.py
generate
called by 4
spectrumlab/models/base.py
format_link
called by 3
leaderboard/gradio/app.py

Shape

Method 92
Function 84
Class 31

Languages

Python100%
TypeScript1%

Modules by API surface

leaderboard/gradio/app.py15 symbols
spectrumlab/models/claude_api.py12 symbols
spectrumlab/evaluator/base.py11 symbols
spectrumlab/models/qwen_vl_api.py9 symbols
spectrumlab/benchmark/base.py9 symbols
leaderboard/manage_leaderboard.py9 symbols
spectrumlab/evaluator/open_evaluator.py7 symbols
spectrumlab/evaluator/choice_evaluator.py7 symbols
spectrumlab/models/llama_api.py6 symbols
spectrumlab/models/gpt4_v_api.py6 symbols
spectrumlab/models/doubao_api.py6 symbols
tests/models/test_qwen_vl_2_5_72b.py4 symbols

For agents

$ claude mcp add SpectrumLab \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact