Informal (vibes-based) evaluation of the following vision-language-model captioners:
- Florence-2-base-ft
- CogVLM2
- BLIP-2
- MoonDream2
- Share-Captioner
- Florence-2-SD3-Captioner
# Contains MIT-licensed code from wandb | |
# https://github.com/wandb/wandb/blob/main/LICENSE | |
# This gist is MIT-licensed (Copyright Alex Birch) | |
from torch import Tensor, FloatTensor | |
from torch.nn import Module | |
from torch.utils.hooks import RemovableHandle | |
import torch | |
from typing import List, Callable, Dict, Sequence, Optional, Tuple, Any | |
from wandb.wandb_torch import log_track_init, log_track_update |
from torch import FloatTensor, LongTensor, Tensor, Size, lerp, zeros_like | |
from torch.linalg import norm | |
# adapted to PyTorch from: | |
# https://gist.github.com/dvschultz/3af50c40df002da3b751efab1daddf2c | |
# most of the extra complexity is to support: | |
# - many-dimensional vectors | |
# - v0 or v1 with last dim all zeroes, or v0 ~colinear with v1 | |
# - falls back to lerp() | |
# - conditional logic implemented with parallelism rather than Python loops |
Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.
Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.
The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.
:root { | |
--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; | |
--body-color: rgba(255, 255, 255, 0.7); | |
--body-background: #282c34; | |
--header-link-color: #9b9494; | |
--header-active-link-color: #d19a66; | |
--input-border: 1px solid #2c384e; | |
--input-background: #2c384e; | |
--input-placeholder-color: #888; | |
--input-focus-border-color: #d19a66; |
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
Responding to requests via simple route matching is built in to Go's net/http
standard library package. Just register the path prefixes and callbacks you want invoked and then call the ListenAndServe
to have the default request handler invoked on each request. For example:
package main
import (
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}"/> | |
<meta name="robots" content="noodp"/> | |
<link rel="canonical" href="{{ .Permalink }}" /> | |
<!-- Twitter Card --> | |
<meta name="twitter:card" content="summary" /> | |
<meta name="twitter:description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" /> | |
<meta name="twitter:title" content="{{ .Title }}{{ if .IsHome }} - {{ .Site.Params.Tagline }}{{ else }} - {{ .Site.Title }}{{ end }}" /> | |
<meta name="twitter:site" content="{{ .Site.Params.twitter }}" /> | |
<meta name="twitter:creator" content="{{ .Site.Params.twitter }}" /> |