Spaces:
Paused
Paused
Julian Bilcke
commited on
Commit
·
68cf43c
1
Parent(s):
f95b0b5
improvements
Browse files- src/app/agents/ant.ts +7 -0
- src/app/agents/city.ts +53 -0
- src/app/agents/dungeon.ts +57 -0
- src/app/agents/fish.ts +9 -1
- src/app/agents/fox.ts +6 -0
- src/app/agents/index.ts +4 -2
- src/app/agents/smith.ts +9 -1
- src/app/agents/types.ts +2 -1
- src/app/types.ts +36 -0
src/app/agents/ant.ts
CHANGED
|
@@ -18,17 +18,23 @@ const positions = [
|
|
| 18 |
"on the ground"
|
| 19 |
]
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
export const agent: Agent = {
|
| 22 |
title: "Ant",
|
| 23 |
type: "ant",
|
| 24 |
simulate: (): Scene => {
|
| 25 |
const action = pick(actions)
|
| 26 |
const position = pick(positions)
|
|
|
|
| 27 |
|
| 28 |
const prompt = [
|
| 29 |
`close-up shot of a couple of ants`,
|
| 30 |
action,
|
| 31 |
position,
|
|
|
|
| 32 |
`high res`,
|
| 33 |
`documentary`,
|
| 34 |
].join(", ")
|
|
@@ -36,6 +42,7 @@ export const agent: Agent = {
|
|
| 36 |
return {
|
| 37 |
action,
|
| 38 |
position,
|
|
|
|
| 39 |
prompt
|
| 40 |
}
|
| 41 |
}
|
|
|
|
| 18 |
"on the ground"
|
| 19 |
]
|
| 20 |
|
| 21 |
+
const times = [
|
| 22 |
+
"during the day",
|
| 23 |
+
]
|
| 24 |
+
|
| 25 |
export const agent: Agent = {
|
| 26 |
title: "Ant",
|
| 27 |
type: "ant",
|
| 28 |
simulate: (): Scene => {
|
| 29 |
const action = pick(actions)
|
| 30 |
const position = pick(positions)
|
| 31 |
+
const time = pick(times)
|
| 32 |
|
| 33 |
const prompt = [
|
| 34 |
`close-up shot of a couple of ants`,
|
| 35 |
action,
|
| 36 |
position,
|
| 37 |
+
time,
|
| 38 |
`high res`,
|
| 39 |
`documentary`,
|
| 40 |
].join(", ")
|
|
|
|
| 42 |
return {
|
| 43 |
action,
|
| 44 |
position,
|
| 45 |
+
time,
|
| 46 |
prompt
|
| 47 |
}
|
| 48 |
}
|
src/app/agents/city.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { pick } from "./pick"
|
| 2 |
+
import { Agent, Scene } from "./types"
|
| 3 |
+
|
| 4 |
+
const actions = [
|
| 5 |
+
"busy pedestrians",
|
| 6 |
+
"busy traffic",
|
| 7 |
+
"typical street life",
|
| 8 |
+
"skyscrapper being constructed",
|
| 9 |
+
"a building is on fire",
|
| 10 |
+
]
|
| 11 |
+
|
| 12 |
+
const positions = [
|
| 13 |
+
"city center with skyscrappers",
|
| 14 |
+
"city center with a hospital",
|
| 15 |
+
"market area",
|
| 16 |
+
"residential area with small houses",
|
| 17 |
+
"residential area and houses with pools",
|
| 18 |
+
"industrial area with a smoking factory",
|
| 19 |
+
"beachfront area with villas",
|
| 20 |
+
"theme park with one big rollercoaster"
|
| 21 |
+
]
|
| 22 |
+
|
| 23 |
+
const times = [
|
| 24 |
+
"during the day",
|
| 25 |
+
// "during the night",
|
| 26 |
+
]
|
| 27 |
+
|
| 28 |
+
export const agent: Agent = {
|
| 29 |
+
title: "City",
|
| 30 |
+
type: "city",
|
| 31 |
+
simulate: (): Scene => {
|
| 32 |
+
const action = pick(actions)
|
| 33 |
+
const position = pick(positions)
|
| 34 |
+
const time = pick(times)
|
| 35 |
+
|
| 36 |
+
const prompt = [
|
| 37 |
+
`static isometrical view of 3D rendered city`,
|
| 38 |
+
action,
|
| 39 |
+
position,
|
| 40 |
+
time,
|
| 41 |
+
`isometric`,
|
| 42 |
+
`game`,
|
| 43 |
+
`high res`,
|
| 44 |
+
].join(", ")
|
| 45 |
+
|
| 46 |
+
return {
|
| 47 |
+
action,
|
| 48 |
+
position,
|
| 49 |
+
time,
|
| 50 |
+
prompt
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
}
|
src/app/agents/dungeon.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { pick } from "./pick"
|
| 2 |
+
import { Agent, Scene } from "./types"
|
| 3 |
+
|
| 4 |
+
const actions = [
|
| 5 |
+
"not moving",
|
| 6 |
+
"walking in",
|
| 7 |
+
"looking up",
|
| 8 |
+
"looking down",
|
| 9 |
+
"looking left",
|
| 10 |
+
"looking right",
|
| 11 |
+
"looking around"
|
| 12 |
+
]
|
| 13 |
+
|
| 14 |
+
const positions = [
|
| 15 |
+
"corridor with a beautiful wooden door at the end, wooden floor and stone walls",
|
| 16 |
+
"a beautiful wooden door",
|
| 17 |
+
"beautiful room with stone walls and wooden floor",
|
| 18 |
+
"large ball room with stone pillars, stone floor and red carpet",
|
| 19 |
+
"a cosy room with a fireplace, stone walls and wooden floor",
|
| 20 |
+
"a fireplace with stone walls",
|
| 21 |
+
"a cold dungeon with stone walls",
|
| 22 |
+
"a damp medieval jail cell with stone walls and wooden floor"
|
| 23 |
+
]
|
| 24 |
+
|
| 25 |
+
const times = [
|
| 26 |
+
"lit through windows",
|
| 27 |
+
"lit through wall-mounted torchs"
|
| 28 |
+
// "poorly lit"
|
| 29 |
+
]
|
| 30 |
+
|
| 31 |
+
export const agent: Agent = {
|
| 32 |
+
title: "Dungeon",
|
| 33 |
+
type: "dungeon",
|
| 34 |
+
simulate: (): Scene => {
|
| 35 |
+
const action = pick(actions)
|
| 36 |
+
const position = pick(positions)
|
| 37 |
+
const time = pick(times)
|
| 38 |
+
|
| 39 |
+
const prompt = [
|
| 40 |
+
`first-person footage`,
|
| 41 |
+
action,
|
| 42 |
+
position,
|
| 43 |
+
time,
|
| 44 |
+
`medieval`,
|
| 45 |
+
`photography`,
|
| 46 |
+
`documentary`,
|
| 47 |
+
`high res`,
|
| 48 |
+
].join(", ")
|
| 49 |
+
|
| 50 |
+
return {
|
| 51 |
+
action,
|
| 52 |
+
position,
|
| 53 |
+
time,
|
| 54 |
+
prompt
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
}
|
src/app/agents/fish.ts
CHANGED
|
@@ -21,24 +21,32 @@ const positions = [
|
|
| 21 |
"hiding in the coral"
|
| 22 |
]
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
export const agent: Agent = {
|
| 25 |
title: "Fish",
|
| 26 |
type: "fish",
|
| 27 |
simulate: (): Scene => {
|
| 28 |
const action = pick(actions)
|
| 29 |
const position = pick(positions)
|
|
|
|
| 30 |
|
| 31 |
const prompt = [
|
| 32 |
`medium shot of a clownfish`,
|
| 33 |
action,
|
| 34 |
position,
|
|
|
|
| 35 |
`in front of yellow coral`,
|
| 36 |
-
`high res
|
|
|
|
| 37 |
].join(", ")
|
| 38 |
|
| 39 |
return {
|
| 40 |
action,
|
| 41 |
position,
|
|
|
|
| 42 |
prompt
|
| 43 |
}
|
| 44 |
}
|
|
|
|
| 21 |
"hiding in the coral"
|
| 22 |
]
|
| 23 |
|
| 24 |
+
const times = [
|
| 25 |
+
"during the day",
|
| 26 |
+
]
|
| 27 |
+
|
| 28 |
export const agent: Agent = {
|
| 29 |
title: "Fish",
|
| 30 |
type: "fish",
|
| 31 |
simulate: (): Scene => {
|
| 32 |
const action = pick(actions)
|
| 33 |
const position = pick(positions)
|
| 34 |
+
const time = pick(times)
|
| 35 |
|
| 36 |
const prompt = [
|
| 37 |
`medium shot of a clownfish`,
|
| 38 |
action,
|
| 39 |
position,
|
| 40 |
+
time,
|
| 41 |
`in front of yellow coral`,
|
| 42 |
+
`high res`,
|
| 43 |
+
`underwater footage`,
|
| 44 |
].join(", ")
|
| 45 |
|
| 46 |
return {
|
| 47 |
action,
|
| 48 |
position,
|
| 49 |
+
time,
|
| 50 |
prompt
|
| 51 |
}
|
| 52 |
}
|
src/app/agents/fox.ts
CHANGED
|
@@ -18,6 +18,9 @@ const positions = [
|
|
| 18 |
"in front of a bush"
|
| 19 |
]
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
export const agent: Agent = {
|
| 23 |
title: "Fox",
|
|
@@ -25,11 +28,13 @@ export const agent: Agent = {
|
|
| 25 |
simulate: (): Scene => {
|
| 26 |
const action = pick(actions)
|
| 27 |
const position = pick(positions)
|
|
|
|
| 28 |
|
| 29 |
const prompt = [
|
| 30 |
`medium shot of a fox`,
|
| 31 |
action,
|
| 32 |
position,
|
|
|
|
| 33 |
`high res`,
|
| 34 |
`documentary`,
|
| 35 |
].join(", ")
|
|
@@ -37,6 +42,7 @@ export const agent: Agent = {
|
|
| 37 |
return {
|
| 38 |
action,
|
| 39 |
position,
|
|
|
|
| 40 |
prompt
|
| 41 |
}
|
| 42 |
}
|
|
|
|
| 18 |
"in front of a bush"
|
| 19 |
]
|
| 20 |
|
| 21 |
+
const times = [
|
| 22 |
+
"during the day",
|
| 23 |
+
]
|
| 24 |
|
| 25 |
export const agent: Agent = {
|
| 26 |
title: "Fox",
|
|
|
|
| 28 |
simulate: (): Scene => {
|
| 29 |
const action = pick(actions)
|
| 30 |
const position = pick(positions)
|
| 31 |
+
const time = pick(times)
|
| 32 |
|
| 33 |
const prompt = [
|
| 34 |
`medium shot of a fox`,
|
| 35 |
action,
|
| 36 |
position,
|
| 37 |
+
time,
|
| 38 |
`high res`,
|
| 39 |
`documentary`,
|
| 40 |
].join(", ")
|
|
|
|
| 42 |
return {
|
| 43 |
action,
|
| 44 |
position,
|
| 45 |
+
time,
|
| 46 |
prompt
|
| 47 |
}
|
| 48 |
}
|
src/app/agents/index.ts
CHANGED
|
@@ -4,9 +4,11 @@ import { agent as ant } from "./ant"
|
|
| 4 |
import { agent as fish } from "./fish"
|
| 5 |
import { agent as fox } from "./fox"
|
| 6 |
import { agent as smith } from "./smith"
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
export const agents = { ant, fish, fox, smith }
|
| 9 |
|
| 10 |
-
export const defaultAgent: AgentType = "
|
| 11 |
|
| 12 |
export const getAgent = (type?: AgentType) => agents[type || defaultAgent] || agents[defaultAgent]
|
|
|
|
| 4 |
import { agent as fish } from "./fish"
|
| 5 |
import { agent as fox } from "./fox"
|
| 6 |
import { agent as smith } from "./smith"
|
| 7 |
+
import { agent as city } from "./city"
|
| 8 |
+
import { agent as dungeon } from "./dungeon"
|
| 9 |
|
| 10 |
+
export const agents = { ant, fish, fox, smith, city, dungeon }
|
| 11 |
|
| 12 |
+
export const defaultAgent: AgentType = "dungeon"
|
| 13 |
|
| 14 |
export const getAgent = (type?: AgentType) => agents[type || defaultAgent] || agents[defaultAgent]
|
src/app/agents/smith.ts
CHANGED
|
@@ -17,25 +17,33 @@ const positions = [
|
|
| 17 |
"on the sidewalk of a street"
|
| 18 |
]
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
export const agent: Agent = {
|
| 21 |
title: "Smith",
|
| 22 |
type: "smith",
|
| 23 |
simulate: (): Scene => {
|
| 24 |
const action = pick(actions)
|
| 25 |
const position = pick(positions)
|
|
|
|
| 26 |
|
| 27 |
const prompt = [
|
| 28 |
`static medium shot of Agent Smith from the Matrix`,
|
| 29 |
`wearing a black costume with black tie and black sunglasses`,
|
| 30 |
action,
|
| 31 |
position,
|
|
|
|
| 32 |
`high res`,
|
| 33 |
-
`
|
| 34 |
].join(", ")
|
| 35 |
|
| 36 |
return {
|
| 37 |
action,
|
| 38 |
position,
|
|
|
|
| 39 |
prompt
|
| 40 |
}
|
| 41 |
}
|
|
|
|
| 17 |
"on the sidewalk of a street"
|
| 18 |
]
|
| 19 |
|
| 20 |
+
const times = [
|
| 21 |
+
"during the day",
|
| 22 |
+
"during the night",
|
| 23 |
+
]
|
| 24 |
+
|
| 25 |
export const agent: Agent = {
|
| 26 |
title: "Smith",
|
| 27 |
type: "smith",
|
| 28 |
simulate: (): Scene => {
|
| 29 |
const action = pick(actions)
|
| 30 |
const position = pick(positions)
|
| 31 |
+
const time = pick(times)
|
| 32 |
|
| 33 |
const prompt = [
|
| 34 |
`static medium shot of Agent Smith from the Matrix`,
|
| 35 |
`wearing a black costume with black tie and black sunglasses`,
|
| 36 |
action,
|
| 37 |
position,
|
| 38 |
+
time,
|
| 39 |
`high res`,
|
| 40 |
+
`Matrix movie`,
|
| 41 |
].join(", ")
|
| 42 |
|
| 43 |
return {
|
| 44 |
action,
|
| 45 |
position,
|
| 46 |
+
time,
|
| 47 |
prompt
|
| 48 |
}
|
| 49 |
}
|
src/app/agents/types.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
-
export type AgentType = 'ant' | 'fish' | 'fox' | 'smith'
|
| 2 |
|
| 3 |
export interface Scene {
|
| 4 |
action: string
|
| 5 |
position: string
|
|
|
|
| 6 |
prompt: string
|
| 7 |
}
|
| 8 |
|
|
|
|
| 1 |
+
export type AgentType = 'ant' | 'fish' | 'fox' | 'smith' | 'city' | 'dungeon'
|
| 2 |
|
| 3 |
export interface Scene {
|
| 4 |
action: string
|
| 5 |
position: string
|
| 6 |
+
time: string
|
| 7 |
prompt: string
|
| 8 |
}
|
| 9 |
|
src/app/types.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
export interface RenderRequest {
|
| 3 |
+
prompt: string
|
| 4 |
+
|
| 5 |
+
// whether to use video segmentation
|
| 6 |
+
// disabled (default)
|
| 7 |
+
// firstframe: we only analyze the first frame
|
| 8 |
+
// allframes: we analyze all the frames
|
| 9 |
+
segmentation: 'disabled' | 'firstframe' | 'allframes'
|
| 10 |
+
|
| 11 |
+
// segmentation will only be executed if we have a non-empty list of actionnables
|
| 12 |
+
// actionnables are names of things like "chest", "key", "tree", "chair" etc
|
| 13 |
+
actionnables: string[]
|
| 14 |
+
|
| 15 |
+
// note: this is the number of frames for Zeroscope,
|
| 16 |
+
// which is currently configured to only output 3 seconds, so:
|
| 17 |
+
// nbFrames=8 -> 1 sec
|
| 18 |
+
// nbFrames=16 -> 2 sec
|
| 19 |
+
// nbFrames=24 -> 3 sec
|
| 20 |
+
nbFrames: number // min: 8, max: 24
|
| 21 |
+
|
| 22 |
+
nbSteps: number // min: 1, max: 50
|
| 23 |
+
|
| 24 |
+
seed: number
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
export interface ImageSegment {
|
| 28 |
+
id: number
|
| 29 |
+
box: number[]
|
| 30 |
+
label: string
|
| 31 |
+
score: number
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
export interface RenderResponse {
|
| 35 |
+
|
| 36 |
+
}
|