repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/migrations/versions/4fe4c96ad3dd_resetting_storage.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:50.744400 | """Resetting storage
Revision ID: 4fe4c96ad3dd
Revises: d02fb88a3355
Create Date: 2026-02-03 13:58:33.470435
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "4fe4c96ad3dd"
down_revision: Union[str, Sequence[str], None] =... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/migrations/versions/f45484bf96b0_update_deployment.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:50.745316 | """Update deployment
Revision ID: f45484bf96b0
Revises: b6bd1dff4015
Create Date: 2026-01-21 12:48:15.025887
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "f45484bf96b0"
down_revision: Union[str, Sequence[str], None] =... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/migrations/versions/d02fb88a3355_add_deployment_image.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:50.747501 | """Add deployment image
Revision ID: d02fb88a3355
Revises: f45484bf96b0
Create Date: 2026-02-01 14:51:05.125947
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'd02fb88a3355'
down_revision: Union[str, Sequence[str], None... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/migrations/versions/454328a03102_initial.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:51.460287 | """Initial schema
Revision ID: 454328a03102
Revises:
Create Date: 2025-08-21 03:10:16.158338
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "454328a03102"
down_revision: Union[str, Sequence[str], None] = None
branch_la... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/models.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:51.573572 | from __future__ import annotations
from sqlalchemy import (
BigInteger,
Boolean,
Enum as SQLAEnum,
JSON,
String,
Text,
ForeignKey,
UniqueConstraint,
Index,
event,
select,
update,
func,
)
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.ext.asyncio impo... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/migrations/versions/31fe53421216_tokens_invalid_before.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:51.687145 | """Add tokens invalid before column to user table
Revision ID: 31fe53421216
Revises: 87a893d57c86
Create Date: 2025-12-29 14:27:16.803188
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "31fe53421216"
down_revision: Uni... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/migrations/env.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:51.800695 | from logging.config import fileConfig
from sqlalchemy import create_engine, pool
from alembic import context
from config import get_settings
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python logging.
#... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/migrations/versions/87a893d57c86_allowlist.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:51.912734 | """Add allowlist table
Revision ID: 87a893d57c86
Revises: 454328a03102
Create Date: 2025-11-13 04:44:28.018622
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "87a893d57c86"
down_revision: Union[str, Sequence[str], None... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/routers/admin.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.027843 | import logging
import os
import re
import json
import httpx
from datetime import datetime, timezone
from fastapi import APIRouter, Request, Depends, Query
from starlette.responses import RedirectResponse
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select, or_
from arq.connections import ArqRe... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/routers/project.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.116339 | from fastapi import APIRouter, Depends, Request, Query, HTTPException
import httpx
from fastapi.responses import Response, RedirectResponse
from sqlalchemy import select, update
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import selectinload
from datetime import datetime, timedelta, timezone
fro... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/routers/team.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.135185 | import os
import logging
from typing import Any
from datetime import timedelta
from fastapi import APIRouter, Depends, Request, Query, HTTPException
from fastapi.responses import RedirectResponse, Response
from sqlalchemy import select, func
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import se... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/routers/user.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.247304 | import logging
import os
from fastapi import APIRouter, Request, Depends, Query
from sqlalchemy.orm import joinedload
from starlette.responses import RedirectResponse, Response
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select, delete, insert
from arq.connections import ArqRedis
from typing ... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/services/deployment.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.377277 | import os
import re
import tempfile
import yaml
import aiodocker
import logging
from datetime import datetime, timezone
from pathlib import Path
from sqlalchemy import or_, select
from sqlalchemy.ext.asyncio import AsyncSession
from redis.asyncio import Redis
from arq.connections import ArqRedis
from arq.jobs import Jo... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/services/domain.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.507135 | import dns.resolver
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from config import Settings
from models import Deployment
class DomainService:
def __init__(self, settings: Settings):
self.server_ip = settings.server_ip
self.deploy_domain = settings.deploy_domain
... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/services/github.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.608889 | import httpx
import jwt
import time
from typing import Any
from email.utils import parsedate_to_datetime
class GitHubService:
def __init__(
self, client_id: str, client_secret: str, app_id: str, private_key: str
):
self.client_id = client_id
self.client_secret = client_secret
s... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/services/loki.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.722413 | import httpx
import re
import time
from typing import List, Dict, Any
import logging
from utils.log import epoch_nano_to_iso, parse_structured_log
logger = logging.getLogger(__name__)
class LokiService:
def __init__(self, loki_url: str = "http://loki:3100"):
self.loki_url = loki_url
self.client ... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/services/github_installation.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.722930 | from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
from datetime import datetime, timezone
from models import GithubInstallation
from services.github import GitHubService
class GitHubInstallationService:
def __init__(self, github_service: GitHubService):
self.github_service = g... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/services/preset_detector.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.836810 | """Preset detection service for automatically identifying project types."""
import fnmatch
import json
import logging
from typing import Optional
from services.github import GitHubService
logger = logging.getLogger(__name__)
class PresetDetector:
"""Detect preset from repository files.
Uses GitHub's git t... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/services/registry.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:52.968192 | import copy
import json
import logging
from dataclasses import dataclass
from pathlib import Path
from urllib.parse import urlparse
import httpx
from pydantic import BaseModel, TypeAdapter, ValidationError
logger = logging.getLogger(__name__)
class PresetVariantConfigSetting(BaseModel):
runner: str | None = Non... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/access.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:53.080882 | import re
from typing import Any
import httpx
from sqlalchemy import func, select
from sqlalchemy.ext.asyncio import AsyncSession
from models import Allowlist
def _empty_entry() -> dict[str, Any]:
return {
"signature": None,
"emails": set(),
"domains": set(),
"regex": [],
}
... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/color.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:53.232260 | from functools import lru_cache
COLORS = [
'blue',
'indigo',
'violet',
'purple',
'fuchsia',
'pink',
'rose',
'red',
'orange',
'amber',
'yellow',
'lime',
'green',
'emerald',
'teal',
'cyan',
'sky',
]
@lru_cache
def get_color(id: str | int) -> str:
"... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/email.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:53.345285 | from smtplib import SMTP
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import resend
from config import Settings
def send_email_by_resend(
recipients: list[str], subject: str, data: str, settings: Settings
) -> None:
resend.api_key = settings.resend_api_key
resend.E... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/environment.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:53.352131 | def get_environment_for_branch(branch, environments) -> dict | None:
"""
Find the highest priority environment that matches a branch.
Args:
branch: The branch name
environments: List of environments in priority order (highest first)
Returns:
The matching environment or ... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/log.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:53.465442 | import json
import re
from datetime import datetime, timezone
LEVEL_ALIASES = {
"debug": "DEBUG",
"info": "INFO",
"success": "SUCCESS",
"warn": "WARNING",
"warning": "WARNING",
"error": "ERROR",
"fatal": "CRITICAL",
"critical": "CRITICAL",
}
LEVEL_PATTERN = re.compile(
r"""(?ix)
... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/pagination.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:53.578261 | from sqlalchemy import select, func
from sqlalchemy.ext.asyncio import AsyncSession
async def paginate(db: AsyncSession, query, page=1, per_page=25):
offset = (page - 1) * per_page
# Get total count
count_query = select(func.count()).select_from(query.subquery())
total = (await db.execute(count_qu... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/project.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:53.690618 | from sqlalchemy import select
from models import Project, Deployment
async def get_latest_projects(db, team, current_project=None, limit=4):
query = (
select(Project)
.where(Project.status != "deleted", Project.team_id == team.id)
.order_by(Project.updated_at.desc())
)
if limit:
... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/storage.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:53.832031 | import sqlite3
import time
WRITE_KEYWORDS = {
"insert",
"update",
"delete",
"replace",
"create",
"drop",
"alter",
"truncate",
"vacuum",
"reindex",
"pragma",
}
def is_write_query(sql: str) -> bool:
statement = sql.strip()
while statement.startswith("--") or stateme... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/urls.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:53.962648 | from urllib.parse import unquote, urlparse
from fastapi import Request
def _validated_redirect_target(
request: Request | None,
candidate: str | None,
allow_absolute: bool = False,
) -> str | None:
"""Validate a redirect target; allow same-origin absolute URLs only when enabled."""
if not candida... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/team.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:54.036150 | from sqlalchemy import select
from models import Team, TeamMember
async def get_latest_teams(db, current_user, current_team=None, limit=4):
query = (
select(Team)
.join(TeamMember, Team.id == TeamMember.team_id)
.where(Team.status != "deleted", TeamMember.user_id == current_user.id)
... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/utils/user.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:54.076512 | from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select, func
import re
from models import User, UserIdentity
def sanitize_username(username: str) -> str:
sanitized = re.sub(r"[^\w-]", "-", username.lower())
return re.sub(r"-+", "-", sanitized).strip("-")
async def get_user_by_email(d... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/workers/jobs.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:54.188806 | import logging
from arq.connections import RedisSettings
from workers.tasks.deployment import (
start_deployment,
finalize_deployment,
fail_deployment,
delete_container,
cleanup_inactive_containers,
)
from workers.tasks.project import delete_project
from workers.tasks.storage import provision_storag... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/workers/monitor.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:54.245849 | import asyncio
import logging
import aiodocker
from sqlalchemy import select, exc, inspect
from arq.connections import ArqRedis, RedisSettings, create_pool
import httpx
from datetime import datetime, timezone
from config import get_settings
from db import AsyncSessionLocal
from models import Deployment
from services.d... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/workers/tasks/deployment.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:54.431180 | import asyncio
import aiodocker
import logging
from sqlalchemy import select, true
from sqlalchemy.orm import joinedload
from pathlib import Path
import shlex
from models import Alias, Deployment, Project
from db import AsyncSessionLocal
from dependencies import (
get_redis_client,
get_github_installation_serv... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/workers/tasks/project.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:54.561567 | import logging
import os
import time
import aiodocker
from sqlalchemy import select, delete
from config import get_settings
from db import AsyncSessionLocal
from models import Alias, Deployment, Domain, Project, StorageProject
logger = logging.getLogger(__name__)
async def delete_project(ctx, project_id: str, batc... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/workers/tasks/registry.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:54.674394 | import logging
import aiodocker
from pathlib import Path
from config import get_settings
from services.registry import RegistryService
logger = logging.getLogger(__name__)
async def pull_runner_image(ctx, runner_slug: str):
settings = get_settings()
registry_service = RegistryService(Path(settings.data_dir)... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/routers/event.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:56.385056 | import logging
from fastapi import APIRouter, Depends, Request, Query
from fastapi.responses import StreamingResponse
from redis.asyncio import Redis
import asyncio
import time
from typing import Any
from datetime import datetime
from models import Team, Project, Deployment, User
from dependencies import (
get_cur... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/routers/github.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:56.406890 | import logging
import hmac
import hashlib
from fastapi import APIRouter, Request, Depends, HTTPException
from fastapi.responses import RedirectResponse, Response
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select, update
from redis.asyncio import Redis
from arq.connections import ArqRedis
imp... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/routers/auth.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:56.407646 | from typing import Annotated
import logging
from fastapi import APIRouter, Request, Depends, HTTPException
from starlette.responses import RedirectResponse
from authlib.jose import jwt
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
from sqlalchemy.exc import IntegrityError
from sqlalchemy... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/routers/google.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:56.476474 | from fastapi import APIRouter, Request, Depends
from fastapi.responses import RedirectResponse
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
from dependencies import (
get_current_user,
get_google_oauth_client,
get_google_user_info,
flash,
get_db,
get_translation... |
instillai/deep-learning-roadmap | https://github.com/instillai/deep-learning-roadmap | null | null | null | null | 4,637 | null | null | mit | null | null | null | null | null | null | null | conf.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:59.327475 | import os
import sys
import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath('_ext'))
# from recommonmark.parser import CommonMarkParser
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.dirname(__file__))
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "readthedocs.settings.dev")
# from django.... |
instillai/deep-learning-roadmap | https://github.com/instillai/deep-learning-roadmap | null | null | null | null | 4,637 | null | null | mit | null | null | null | null | null | null | null | source/conf.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:59.328171 | import os
import sys
import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath('_ext'))
# from recommonmark.parser import CommonMarkParser
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.dirname(__file__))
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "readthedocs.settings.dev")
# from django.... |
Blealtan/efficient-kan | https://github.com/Blealtan/efficient-kan | null | null | null | null | 4,633 | null | null | mit | null | null | null | null | null | null | null | examples/mnist.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:01.609656 | from efficient_kan import KAN
# Train on MNIST
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from tqdm import tqdm
# Load MNIST
transform = transforms.Compose(
[transforms.ToTensor(), transforms... |
Blealtan/efficient-kan | https://github.com/Blealtan/efficient-kan | null | null | null | null | 4,633 | null | null | mit | null | null | null | null | null | null | null | src/efficient_kan/kan.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:01.621214 | import torch
import torch.nn.functional as F
import math
class KANLinear(torch.nn.Module):
def __init__(
self,
in_features,
out_features,
grid_size=5,
spline_order=3,
scale_noise=0.1,
scale_base=1.0,
scale_spline=1.0,
enable_standalone_scale_... |
Blealtan/efficient-kan | https://github.com/Blealtan/efficient-kan | null | null | null | null | 4,633 | null | null | mit | null | null | null | null | null | null | null | tests/test_simple_math.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:01.691095 | import torch
import torch.nn as nn
from tqdm import tqdm
from efficient_kan import KAN
def test_mul():
kan = KAN([2, 2, 1], base_activation=nn.Identity)
optimizer = torch.optim.LBFGS(kan.parameters(), lr=1)
with tqdm(range(100)) as pbar:
for i in pbar:
loss, reg_loss = None, None
... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char00 Conventional Algorithms/Sarsa.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:04.341842 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import time
ALPHA = 0.1
GAMMA = 0.95
EPSILION = 0.9
N_STATE = 6
ACTIONS = ['left', 'right']
MAX_EPISODES = 200
FRESH_TIME = 0.1
def build_q_table(n_state, actions):
q_table = pd.DataFrame(
np.zeros((n_state, len(actions))),
np.arange(... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char00 Conventional Algorithms/gridworld.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:04.343220 |
import numpy as np
class GridWorld:
def __init__(self, tot_row, tot_col):
self.action_space_size = 4
self.world_row = tot_row
self.world_col = tot_col
#The world is a matrix of size row x col x 2
#The first layer contains the obstacles
#The second layer contains th... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char01 DQN/DQN_mountain_car_v1.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:04.344425 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
import matplotlib.pyplot as plt
import gym
#hyper parameters
EPSILON = 0.9
GAMMA = 0.9
LR = 0.01
MEMORY_CAPACITY = 2000
Q_NETWORK_ITERATION = 100
BATCH_SIZE = 32
EPISODES = 400
env = gym.make('MountainCar-v0... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char01 DQN/DQN.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:04.344991 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import gym
import matplotlib.pyplot as plt
import copy
# hyper-parameters
BATCH_SIZE = 128
LR = 0.01
GAMMA = 0.90
EPISILO = 0.9
MEMORY_CAPACITY = 2000
Q_NETWORK_ITERATION = 100
env = gym.make("CartPole-v0")
env = env.unwrapped
NUM_A... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char00 Conventional Algorithms/Q-learning.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:04.663800 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import time
ALPHA = 0.1
GAMMA = 0.95
EPSILION = 0.9
N_STATE = 20
ACTIONS = ['left', 'right']
MAX_EPISODES = 200
FRESH_TIME = 0.1
def build_q_table(n_state, actions):
q_table = pd.DataFrame(
np.zeros((n_state, len(actions))),
np.arange(... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char02 Policy Gradient/REINFORCE.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:04.665976 | import argparse
import gym
import numpy as np
from itertools import count
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Categorical
parser = argparse.ArgumentParser(description='PyTorch REINFORCE example')
parser.add_argument('--gamma',... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char01 DQN/DQN_MountainCar-v0.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:04.667361 | import argparse
import pickle
from collections import namedtuple
from itertools import count
import os, time
import numpy as np
import matplotlib.pyplot as plt
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal, Categorical
... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char01 DQN/naiveDQN.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:04.753439 | # Nota that this network won't work because the reward is always 1
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import gym
# hyper-parameters
BATCH_SIZE = 128
LR = 0.01
GAMMA = 0.90
EPISILO = 0.9
MEMORY_CAPACITY = 20000
Q_NETWORK_ITERATION = 100
env = gym.make("CartPole-v0")
... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char01 DQN/DQN_CartPole-v0.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:04.776777 | import argparse
import pickle
from collections import namedtuple
from itertools import count
import os, time
import numpy as np
import matplotlib.pyplot as plt
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal, Categorical
... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char02 Policy Gradient/pytorch_MountainCar-v0.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:05.508122 | # MountainCar V0
import numpy as np
import gym
import matplotlib.pyplot as plt
from itertools import count
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.optim import adam
from torch.distributions import Categorical
env = gym.make('MountainCar-v0')
env = env.unwrapped
env.seed(1)
... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char02 Policy Gradient/naive-policy-gradient.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:05.509131 | import numpy as np
import gym
import matplotlib.pyplot as plt
from itertools import count
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.distributions import Categorical
#Hyperparameters
learning_rate = 0.01
gamma = 0.98
num_episode = 5000
batch_siz... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char02 Policy Gradient/Run_Model.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:05.510423 | # MountainCar V0
#
import numpy as np
import gym
import matplotlib.pyplot as plt
from itertools import count
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.optim import adam
from torch.distributions import Categorical
env = gym.make('MountainCar-v0')
env = env.unwrapped
env.seed(1)... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char02 Policy Gradient/REINFORCE_with_Baseline.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:05.620207 |
import torch.nn as nn
import torch.nn.functional as F
import gym
import torch
from torch.distributions import Categorical
import torch.optim as optim
from copy import deepcopy
import argparse
import matplotlib.pyplot as plt
from tensorboardX import SummaryWriter
from torch.nn.utils import clip_grad_norm_
render = Fa... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char07 PPO/PPO_CartPole_v0.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.085281 | import argparse
import pickle
from collections import namedtuple
from itertools import count
import os, time
import numpy as np
import matplotlib.pyplot as plt
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal, Categorical
... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char07 PPO/PPO2.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.103486 |
import argparse
import pickle
from collections import namedtuple
import os
import numpy as np
import matplotlib.pyplot as plt
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal
from torch.utils.data.sampler import BatchSamp... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char07 PPO/PPO_MountainCar-v0.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.149032 | import argparse
import pickle
from collections import namedtuple
from itertools import count
import os, time
import numpy as np
import matplotlib.pyplot as plt
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal, Categorical
... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char04 A2C/A2C.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.261439 |
import math
import random
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.distributions import Categorical
import matplotlib.pyplot as plt
use_cuda = torch.cuda.is_available()
device = torch.device("cuda" if use_cuda else "cp... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char03 Actor-Critic/AC_CartPole-v0.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.271065 | import gym, os
import numpy as np
import matplotlib.pyplot as plt
from itertools import count
from collections import namedtuple
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.distributions import Categorical
#Parameters
env = gym.make('CartPole-v0')
env = en... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char03 Actor-Critic/AC_MountainCar-v0.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.272034 | import gym, os
import numpy as np
import matplotlib.pyplot as plt
from itertools import count
from collections import namedtuple
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.optim import Adam
from torch.distributions import Categorical
from torch.nn.functional import smooth_l1_lo... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char07 PPO/PPO_pendulum.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.279865 | import argparse
import pickle
from collections import namedtuple
import matplotlib.pyplot as plt
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
pars... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char09 SAC/SAC.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.647142 | import argparse
import pickle
from collections import namedtuple
from itertools import count
import os
import numpy as np
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal
from torch.autograd import grad
from torch.utils.d... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char09 SAC/SAC_BipedalWalker-v2.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.699338 | import argparse
from collections import namedtuple
from itertools import count
import pickle
import os, random
import numpy as np
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal
from tensorboardX import SummaryWriter
''... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char09 SAC/SAC_dual_Q_net.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.727202 | import argparse
from collections import namedtuple
from itertools import count
import os
import numpy as np
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal
from tensorboardX import SummaryWriter
'''
Implementation of s... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char10 TD3/TD3.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.827892 | import argparse
from collections import namedtuple
from itertools import count
import os, sys, random
import numpy as np
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal
from tensorboardX import SummaryWriter
device = 'cu... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char09 SAC/test_agent.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.837695 | import argparse
from collections import namedtuple
from itertools import count
import pickle
import os
import numpy as np
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal
from tensorboardX import SummaryWriter
'''
Implem... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | More/plot.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.849779 | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import re
import os
sns.set(style='darkgrid')
def get_info(filename):
filename = filename.replace('.npy', '') # remove .npy
algo, env, seed = re.split('_', filename)
seed = int(seed)
return algo, env, seed
de... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char10 TD3/TD3_BipedalWalker-v2.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.874467 | import argparse
from collections import namedtuple
from itertools import count
import os, sys, random
import numpy as np
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal
from tensorboardX import SummaryWriter
device = 'cu... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char02 Policy Gradient/PolicyGradient.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:06.875150 |
import argparse
import gym
import numpy as np
from itertools import count
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import matplotlib.pyplot as plt
from torch.distributions import Categorical
parser = argparse.ArgumentParser(description='PyTorch REINFORCE exampl... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char05 DDPG/DDPG.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:10.557834 | import argparse
from itertools import count
import os, sys, random
import numpy as np
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Normal
from tensorboardX import SummaryWriter
'''
Implementation of Deep Deterministic Policy... |
sweetice/Deep-reinforcement-learning-with-pytorch | https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch | null | null | null | null | 4,619 | null | null | mit | null | null | null | null | null | null | null | Char04 A2C/multiprocessing_env.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:10.559947 | #This code is from openai baseline
#https://github.com/openai/baselines/tree/master/baselines/common/vec_env
import numpy as np
from multiprocessing import Process, Pipe
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
while True:
cmd, data = remote... |
luosiallen/latent-consistency-model | https://github.com/luosiallen/latent-consistency-model | null | null | null | null | 4,617 | null | null | mit | null | null | null | null | null | null | null | predict.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:13.600773 | # Prediction interface for Cog ⚙️
# https://github.com/replicate/cog/blob/main/docs/python.md
import os
import torch
from diffusers import DiffusionPipeline
from cog import BasePredictor, Input, Path
class Predictor(BasePredictor):
def setup(self) -> None:
"""Load the model into memory to make running mu... |
luosiallen/latent-consistency-model | https://github.com/luosiallen/latent-consistency-model | null | null | null | null | 4,617 | null | null | mit | null | null | null | null | null | null | null | tungsten_model.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:13.631301 | """
Tungsten model definition
Reference: https://github.com/tungsten-ai/tungstenkit
Before start building a model, download weights & pipeline definition:
$ git lfs install
$ git clone https://huggingface.co/SimianLuo/LCM_Dreamshaper_v7
"""
import os
import random
import sys
from typing import List
import torch
from... |
luosiallen/latent-consistency-model | https://github.com/luosiallen/latent-consistency-model | null | null | null | null | 4,617 | null | null | mit | null | null | null | null | null | null | null | local_gradio/app.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:13.635228 | from __future__ import annotations
import os
import random
import time
import gradio as gr
import numpy as np
import PIL.Image
import torch
try:
import intel_extension_for_pytorch as ipex
except:
pass
from diffusers import DiffusionPipeline
import torch
import os
import torch
from tqdm import tqdm
from con... |
luosiallen/latent-consistency-model | https://github.com/luosiallen/latent-consistency-model | null | null | null | null | 4,617 | null | null | mit | null | null | null | null | null | null | null | LCM_Training_Script/consistency_distillation/train_lcm_distill_lora_sdxl_wds.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:13.651706 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
luosiallen/latent-consistency-model | https://github.com/luosiallen/latent-consistency-model | null | null | null | null | 4,617 | null | null | mit | null | null | null | null | null | null | null | LCM_Training_Script/consistency_distillation/train_lcm_distill_sd_wds.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:13.652452 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
luosiallen/latent-consistency-model | https://github.com/luosiallen/latent-consistency-model | null | null | null | null | 4,617 | null | null | mit | null | null | null | null | null | null | null | LCM_Training_Script/consistency_distillation/train_lcm_distill_lora_sd_wds.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:13.657611 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
luosiallen/latent-consistency-model | https://github.com/luosiallen/latent-consistency-model | null | null | null | null | 4,617 | null | null | mit | null | null | null | null | null | null | null | LCM_Training_Script/consistency_distillation/train_lcm_distill_sdxl_wds.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:13.666276 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/opencv_versions.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:21.744213 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# import the necessary packages
from __future__ import print_function
import imutils
import cv2
# print the current OpenCV version on your system
print("Your OpenCV version: {}".format(cv2.__version__))
# check to see if you are using OpenCV 2.X... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/image_basics.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:21.748334 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND
# python image_basics.py
# import the necessary packages
import matplotlib.pyplot as plt
import imutils
import cv2
# load the example images
bridge = cv2.imread("../demo_imag... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/fps_demo.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:21.749758 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND
# python fps_demo.py
# python fps_demo.py --display 1
# import the necessary packages
from __future__ import print_function
from imutils.video import VideoStream
from imutils.... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/picamera_fps_demo.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:21.750874 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND
# python picamera_fps_demo.py
# python picamera_fps_demo.py --display 1
# import the necessary packages
from __future__ import print_function
from imutils.video import VideoSt... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/encode_image.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:21.752219 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# python encode_image.py --image ../demo_images/pyimagesearch_logo.jpg
# import the necessary packages
from __future__ import print_function
from imutils import encodings
import argparse
import cv2
# construct the argument parser and par... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/feature_demo.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:21.762666 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# python feature_demo.py
# import the necessary packages
from imutils.feature import DescriptorExtractor_create
from imutils.feature import FeatureDetector_create
from imutils.feature import corners_to_keypoints
# ensure the keypoint det... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/perspective_transform.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:21.766508 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND
# python perspective_transform.py
# import the necessary packages
from imutils import perspective
import numpy as np
import cv2
# load the notecard code image, clone it, and initi... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/finding_function_names.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:21.770186 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# python finding_function_names.py
# import the necessary packages
from __future__ import print_function
import imutils
# loop over various function strings to search for and try to
# locate them in the OpenCV library
for funcName in ("c... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/contrast_demo.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:21.818235 | # author: Tim Poulsen
# website: https://www.timpoulsen.com
# USAGE
# from the demos folder:
# python demos/contrast_demo.py -i demo_images/bridge.jpg -b 100
# python demos/contrast_demo.py -i demo_images/bridge.jpg --c 50
# import the necessary packages
from __future__ import print_function
import argparse
impo... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/image_paths.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:21.821121 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# from the demos folder:
# python image_paths.py
# import the necessary packages
from __future__ import print_function
# You'll need to force '../imutils' into the system path if testing
from imutils import paths
# loop over the image pa... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/read_frames_fast.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:22.309645 | # Modified from:
# https://www.pyimagesearch.com/2017/02/06/faster-video-file-fps-with-cv2-videocapture-and-opencv/
# Performance:
# Python 2.7: 105.78 --> 131.75
# Python 3.7: 15.36 --> 50.13
# USAGE
# python read_frames_fast.py --video videos/jurassic_park_intro.mp4
# import the necessary packages
fro... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/text_demo.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:22.350129 | # author: Adam Spannbauer
# USAGE
# python text_demo.py -i ../demo_images/bridge.jpg
# python text_demo.py -i ../demo_images/bridge.jpg -c 0
# import the necessary packages
import argparse
import cv2
import imutils.text
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/temp_file.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:22.351902 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND
# python temp_file.py --image ../demo_images/bridge.jpg
# import the necessary packages
from __future__ import print_function
from imutils.io import TempFile
import argparse
... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/encodings.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:22.389618 | # import the necessary packages
import numpy as np
import base64
import json
import sys
def base64_encode_image(a):
# return a JSON-encoded list of the base64 encoded image, image data
# type, and image shape
#return json.dumps([base64_encode_array(a), str(a.dtype), a.shape])
return json.dumps([base64_encode_array... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | demos/sorting_contours.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:22.392814 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND
# python sorting_contours.py
# import the necessary packages
from imutils import contours
import imutils
import cv2
# load the shapes image clone it, convert it to grayscale,... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:22.396551 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# set the version number
__version__ = "0.5.4"
# import the necessary packages
from .convenience import translate
from .convenience import rotate
from .convenience import rotate_bound
from .convenience import resize
from .convenience import skeletoniz... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/convenience.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:22.404075 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# import the necessary packages
import numpy as np
import cv2
import sys
# import any special Python 2.7 packages
if sys.version_info.major == 2:
from urllib import urlopen
# import any special Python 3 packages
elif sys.version_info.major =... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/contours.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:22.405608 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# import the necessary packages
import cv2
def sort_contours(cnts, method="left-to-right"):
# initialize the reverse flag and sort index
reverse = False
i = 0
# handle if we need to sort in reverse
if method == "right-to-left... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/face_utils/facealigner.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:22.407438 | # import the necessary packages
from .helpers import FACIAL_LANDMARKS_68_IDXS
from .helpers import FACIAL_LANDMARKS_5_IDXS
from .helpers import shape_to_np
import numpy as np
import cv2
class FaceAligner:
def __init__(self, predictor, desiredLeftEye=(0.35, 0.35),
desiredFaceWidth=256, desiredFaceHeight=None):
# s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.