@umituz/react-native-ai-generation-content 1.17.232 → 1.17.233
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +236 -261
- package/package.json +1 -1
- package/src/domains/content-moderation/README.md +239 -296
- package/src/domains/creations/README.md +242 -325
- package/src/domains/face-detection/README.md +228 -307
- package/src/domains/prompts/README.md +242 -312
- package/src/features/ai-hug/README.md +381 -219
- package/src/features/ai-kiss/README.md +388 -219
- package/src/features/anime-selfie/README.md +327 -256
- package/src/features/audio-generation/README.md +352 -309
- package/src/features/colorization/README.md +332 -228
- package/src/features/couple-future/README.md +387 -212
- package/src/features/future-prediction/README.md +391 -221
- package/src/features/hd-touch-up/README.md +339 -252
- package/src/features/image-captioning/README.md +359 -299
- package/src/features/image-to-image/README.md +398 -357
- package/src/features/image-to-video/README.md +337 -292
- package/src/features/inpainting/README.md +348 -244
- package/src/features/meme-generator/README.md +350 -269
- package/src/features/remove-background/README.md +335 -234
- package/src/features/remove-object/README.md +341 -288
- package/src/features/replace-background/README.md +353 -236
- package/src/features/script-generator/README.md +358 -287
- package/src/features/shared/README.md +254 -223
- package/src/features/sketch-to-image/README.md +331 -234
- package/src/features/style-transfer/README.md +336 -237
- package/src/features/text-to-video/README.md +360 -193
- package/src/features/text-to-voice/README.md +382 -272
|
@@ -1,281 +1,451 @@
|
|
|
1
|
-
# Future Prediction
|
|
1
|
+
# Future Prediction Feature
|
|
2
2
|
|
|
3
3
|
Generate images showing people in future scenarios using AI.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 📍 Import Path
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- Various life scenarios
|
|
11
|
-
- High-quality facial matching
|
|
7
|
+
```typescript
|
|
8
|
+
import { useFuturePredictionFeature } from '@umituz/react-native-ai-generation-content';
|
|
9
|
+
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
**Location**: `src/features/future-prediction/`
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
## 🎯 Feature Purpose
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
npm install @umituz/react-native-ai-generation-content
|
|
19
|
-
```
|
|
15
|
+
Create AI-generated images showing individuals in various future scenarios including old age, professional success, dream careers, and future family. Features natural aging progression and high-quality facial matching for entertaining and motivational content.
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### Using the Hook
|
|
24
|
-
|
|
25
|
-
```tsx
|
|
26
|
-
import { useFuturePrediction } from '@umituz/react-native-ai-generation-content';
|
|
27
|
-
import * as ImagePicker from 'react-native-image-picker';
|
|
28
|
-
|
|
29
|
-
function FuturePredictionScreen() {
|
|
30
|
-
const [image, setImage] = useState<string | null>(null);
|
|
31
|
-
|
|
32
|
-
const feature = useFuturePrediction({
|
|
33
|
-
config: {
|
|
34
|
-
scenario: 'old-age',
|
|
35
|
-
onProcessingStart: () => console.log('Generating future image...'),
|
|
36
|
-
onProcessingComplete: (result) => console.log('Complete:', result),
|
|
37
|
-
onError: (error) => console.error('Error:', error),
|
|
38
|
-
},
|
|
39
|
-
onSelectImage: async () => {
|
|
40
|
-
const result = await ImagePicker.launchImageLibrary({ mediaType: 'photo' });
|
|
41
|
-
if (result.assets && result.assets[0].uri) {
|
|
42
|
-
const base64 = await convertToBase64(result.assets[0].uri);
|
|
43
|
-
setImage(base64);
|
|
44
|
-
return base64;
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
},
|
|
48
|
-
onSaveResult: async (imageUrl) => {
|
|
49
|
-
await saveToGallery(imageUrl);
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<View>
|
|
55
|
-
<PhotoUploadCard
|
|
56
|
-
image={image}
|
|
57
|
-
onSelectImage={feature.selectImage}
|
|
58
|
-
title="Select Your Photo"
|
|
59
|
-
/>
|
|
60
|
-
|
|
61
|
-
<ScenarioSelector
|
|
62
|
-
selectedScenario={feature.state.scenario}
|
|
63
|
-
onSelectScenario={feature.setScenario}
|
|
64
|
-
/>
|
|
65
|
-
|
|
66
|
-
<Button
|
|
67
|
-
title="Generate Future Image"
|
|
68
|
-
onPress={feature.process}
|
|
69
|
-
disabled={!feature.isReady || feature.state.isProcessing}
|
|
70
|
-
/>
|
|
71
|
-
|
|
72
|
-
{feature.state.isProcessing && (
|
|
73
|
-
<View>
|
|
74
|
-
<Text>Creating your future image...</Text>
|
|
75
|
-
<ProgressBar progress={feature.state.progress} />
|
|
76
|
-
</View>
|
|
77
|
-
)}
|
|
78
|
-
|
|
79
|
-
{feature.state.result && (
|
|
80
|
-
<ResultDisplay
|
|
81
|
-
originalImage={image}
|
|
82
|
-
resultImage={feature.state.result.imageUrl}
|
|
83
|
-
onSave={() => feature.saveResult()}
|
|
84
|
-
/>
|
|
85
|
-
)}
|
|
86
|
-
</View>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
```
|
|
17
|
+
---
|
|
90
18
|
|
|
91
|
-
|
|
19
|
+
## 📋 Usage Strategy
|
|
92
20
|
|
|
93
|
-
|
|
94
|
-
import { AIFeatureScreen } from '@umituz/react-native-ai-generation-content';
|
|
21
|
+
### When to Use This Feature
|
|
95
22
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
23
|
+
✅ **Use Cases:**
|
|
24
|
+
- Creating fun future predictions for entertainment
|
|
25
|
+
- Generating motivational content
|
|
26
|
+
- Social media sharing
|
|
27
|
+
- Visualizing future goals
|
|
28
|
+
- Creative personal projects
|
|
29
|
+
|
|
30
|
+
❌ **When NOT to Use:**
|
|
31
|
+
- Non-consensual image generation
|
|
32
|
+
- Misleading or deceptive content
|
|
33
|
+
- Harassment or bullying
|
|
34
|
+
- Commercial use without permissions
|
|
35
|
+
- Professional medical aging predictions
|
|
36
|
+
|
|
37
|
+
### Implementation Strategy
|
|
38
|
+
|
|
39
|
+
1. **Select photo** of the person
|
|
40
|
+
2. **Choose future scenario** (old-age, success, future-career, future-family)
|
|
41
|
+
3. **Set target age** (optional, for old-age scenario)
|
|
42
|
+
4. **Generate prediction** with progress tracking
|
|
43
|
+
5. **Preview result** and offer regeneration
|
|
44
|
+
6. **Save or share** final image
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## ⚠️ Critical Rules (MUST FOLLOW)
|
|
49
|
+
|
|
50
|
+
### 1. Image Requirements
|
|
51
|
+
- **MUST** provide ONE clear photo of a person
|
|
52
|
+
- **MUST** contain at least one visible person
|
|
53
|
+
- **MUST** use high-quality images (min 512x512 recommended)
|
|
54
|
+
- **MUST** ensure face is clearly visible
|
|
55
|
+
- **MUST NOT** use images with no detectable people
|
|
56
|
+
|
|
57
|
+
### 2. Configuration
|
|
58
|
+
- **MUST** provide valid `userId` for tracking
|
|
59
|
+
- **MUST** specify `scenario` (old-age, success, future-career, future-family)
|
|
60
|
+
- **MUST** implement `onError` callback
|
|
61
|
+
- **MUST** implement `onSelectImage` callback
|
|
62
|
+
- **MUST** handle image selection before processing
|
|
63
|
+
|
|
64
|
+
### 3. State Management
|
|
65
|
+
- **MUST** check `isReady` before enabling generate button
|
|
66
|
+
- **MUST** verify image is selected
|
|
67
|
+
- **MUST** handle `isProcessing` state to prevent duplicate requests
|
|
68
|
+
- **MUST** display `error` state to users
|
|
69
|
+
- **MUST** implement proper cleanup on unmount
|
|
70
|
+
|
|
71
|
+
### 4. Performance
|
|
72
|
+
- **MUST** limit image size (<10MB)
|
|
73
|
+
- **MUST** compress images before processing
|
|
74
|
+
- **MUST** implement loading indicators during processing
|
|
75
|
+
- **MUST** cache results locally
|
|
76
|
+
- **MUST NOT** generate multiple predictions simultaneously
|
|
77
|
+
|
|
78
|
+
### 5. Ethics & Privacy
|
|
79
|
+
- **MUST** obtain consent from people whose photos are used
|
|
80
|
+
- **MUST** provide clear usage terms
|
|
81
|
+
- **MUST** implement content moderation
|
|
82
|
+
- **MUST** prevent malicious use cases
|
|
83
|
+
- **MUST** log processing for audit trail
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🚫 Prohibitions (MUST AVOID)
|
|
88
|
+
|
|
89
|
+
### Strictly Forbidden
|
|
90
|
+
|
|
91
|
+
❌ **NEVER** do the following:
|
|
92
|
+
|
|
93
|
+
1. **No Missing Image**
|
|
94
|
+
- Always validate image is selected
|
|
95
|
+
- Never attempt generation without photo
|
|
96
|
+
- Show clear upload prompt
|
|
97
|
+
|
|
98
|
+
2. **No Non-Consensual Generation**
|
|
99
|
+
- Always obtain permission from subjects
|
|
100
|
+
- Never generate predictions without consent
|
|
101
|
+
- Implement age verification for minors
|
|
102
|
+
|
|
103
|
+
3. **No Malicious Use**
|
|
104
|
+
- Never use for harassment or bullying
|
|
105
|
+
- Never create misleading content
|
|
106
|
+
- Never use for deception
|
|
107
|
+
|
|
108
|
+
4. **No Unhandled Errors**
|
|
109
|
+
- Never ignore generation failures
|
|
110
|
+
- Always handle detection errors gracefully
|
|
111
|
+
- Provide clear error messages
|
|
112
|
+
|
|
113
|
+
5. **No Memory Leaks**
|
|
114
|
+
- Never store large images in state unnecessarily
|
|
115
|
+
- Always cleanup image references on unmount
|
|
116
|
+
- Implement proper image disposal
|
|
117
|
+
|
|
118
|
+
6. **No Blocked UI**
|
|
119
|
+
- Never process without user confirmation
|
|
120
|
+
- Always show progress indicator
|
|
121
|
+
- Never block main thread with image processing
|
|
122
|
+
|
|
123
|
+
7. **No Medical Claims**
|
|
124
|
+
- Never present results as medically accurate
|
|
125
|
+
- Always label as entertainment/AI-generated
|
|
126
|
+
- Provide disclaimer about AI prediction limitations
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 🤖 AI Agent Directions
|
|
131
|
+
|
|
132
|
+
### For AI Code Generation Tools
|
|
133
|
+
|
|
134
|
+
When using this feature with AI code generation tools, follow these guidelines:
|
|
135
|
+
|
|
136
|
+
#### Prompt Template for AI Agents
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
You are implementing a future prediction feature using @umituz/react-native-ai-generation-content.
|
|
140
|
+
|
|
141
|
+
REQUIREMENTS:
|
|
142
|
+
1. Import from: @umituz/react-native-ai-generation-content
|
|
143
|
+
2. Use the useFuturePredictionFeature hook
|
|
144
|
+
3. Select future scenario (old-age, success, future-career, future-family)
|
|
145
|
+
4. Implement image selection UI
|
|
146
|
+
5. Set target age (optional, for old-age)
|
|
147
|
+
6. Validate image before generation
|
|
148
|
+
7. Add confirmation dialog before generation
|
|
149
|
+
8. Handle long processing times with progress
|
|
150
|
+
9. Implement proper error handling
|
|
151
|
+
10. Implement cleanup on unmount
|
|
152
|
+
|
|
153
|
+
CRITICAL RULES:
|
|
154
|
+
- MUST obtain consent from subjects
|
|
155
|
+
- MUST validate image before calling process()
|
|
156
|
+
- MUST provide clear UI for scenario selection
|
|
157
|
+
- MUST handle generation errors gracefully
|
|
158
|
+
- MUST prevent malicious use cases
|
|
159
|
+
- MUST implement content moderation
|
|
160
|
+
- NEVER present as medically accurate
|
|
161
|
+
- NEVER process without user confirmation
|
|
162
|
+
|
|
163
|
+
CONFIGURATION:
|
|
164
|
+
- Provide valid userId (string)
|
|
165
|
+
- Set scenario: 'old-age' | 'success' | 'future-career' | 'future-family'
|
|
166
|
+
- Set age?: number (target age for old-age, default: 80)
|
|
167
|
+
- Set preserveFaces: boolean (maintain facial features)
|
|
168
|
+
- Set enhanceQuality: boolean (enhance output quality)
|
|
169
|
+
- Implement onSelectImage callback
|
|
170
|
+
- Implement onSaveResult callback
|
|
171
|
+
- Configure callbacks: onProcessingStart, onProcessingComplete, onError
|
|
172
|
+
|
|
173
|
+
SCENARIOS:
|
|
174
|
+
- old-age: Person in old age (supports custom target age)
|
|
175
|
+
- success: Professional success scenario
|
|
176
|
+
- future-career: Dream career visualization
|
|
177
|
+
- future-family: Future family scenario
|
|
178
|
+
|
|
179
|
+
OPTIONS:
|
|
180
|
+
- age: Target age for old-age prediction (50-100)
|
|
181
|
+
- preserveFaces: Maintain facial features (default: true)
|
|
182
|
+
- enhanceQuality: Enhance output quality (default: true)
|
|
183
|
+
|
|
184
|
+
STRICTLY FORBIDDEN:
|
|
185
|
+
- No missing image validation
|
|
186
|
+
- No non-consensual generation
|
|
187
|
+
- No malicious use
|
|
188
|
+
- No unhandled errors
|
|
189
|
+
- No memory leaks
|
|
190
|
+
- No blocking UI
|
|
191
|
+
- No medical claims
|
|
192
|
+
|
|
193
|
+
ETHICS CHECKLIST:
|
|
194
|
+
- [ ] Consent mechanism implemented
|
|
195
|
+
- [ ] Age verification for minors
|
|
196
|
+
- [ ] Content moderation in place
|
|
197
|
+
- [ ] Usage terms provided
|
|
198
|
+
- [ ] Audit trail logging
|
|
199
|
+
- [ ] Entertainment/AI-generated disclaimer
|
|
200
|
+
- [ ] No medical accuracy claims
|
|
104
201
|
```
|
|
105
202
|
|
|
106
|
-
|
|
203
|
+
#### AI Implementation Checklist
|
|
204
|
+
|
|
205
|
+
Use this checklist when generating code:
|
|
206
|
+
|
|
207
|
+
- [ ] Feature imported from correct path
|
|
208
|
+
- [ ] Image selection implemented
|
|
209
|
+
- [ ] Scenario selector added
|
|
210
|
+
- [ ] Age input implemented (for old-age)
|
|
211
|
+
- [ ] Validation before process()
|
|
212
|
+
- [ ] Confirmation dialog added
|
|
213
|
+
- [ ] Progress indicator during processing
|
|
214
|
+
- [ ] Error display with user-friendly message
|
|
215
|
+
- [ ] Result preview before saving
|
|
216
|
+
- [ ] Consent mechanism in place
|
|
217
|
+
- [ ] Cleanup on unmount
|
|
218
|
+
- [ ] Content moderation configured
|
|
219
|
+
- [ ] Disclaimer about AI limitations
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 🛠️ Configuration Strategy
|
|
107
224
|
|
|
108
|
-
###
|
|
225
|
+
### Essential Configuration
|
|
109
226
|
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
227
|
+
```typescript
|
|
228
|
+
// Required fields
|
|
229
|
+
{
|
|
230
|
+
userId: string
|
|
231
|
+
scenario: 'old-age' | 'success' | 'future-career' | 'future-family'
|
|
232
|
+
onSelectImage: () => Promise<string | null>
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Optional callbacks
|
|
236
|
+
{
|
|
237
|
+
age?: number // Target age for old-age (50-100)
|
|
238
|
+
onProcessingStart?: () => void
|
|
239
|
+
onProcessingComplete?: (result) => void
|
|
240
|
+
onError?: (error: string) => void
|
|
117
241
|
}
|
|
118
242
|
```
|
|
119
243
|
|
|
120
|
-
###
|
|
244
|
+
### Recommended Settings
|
|
245
|
+
|
|
246
|
+
1. **Future Scenarios**
|
|
247
|
+
- Old Age: See yourself in old age (supports custom age 50-100)
|
|
248
|
+
- Success: Professional success visualization
|
|
249
|
+
- Future Career: Dream career scenario
|
|
250
|
+
- Future Family: Family scenario
|
|
251
|
+
|
|
252
|
+
2. **Age Settings** (for old-age)
|
|
253
|
+
- Range: 50-100 years
|
|
254
|
+
- Default: 80 years
|
|
255
|
+
- Recommendation: Start with default, adjust as needed
|
|
256
|
+
|
|
257
|
+
3. **Image Quality**
|
|
258
|
+
- Minimum: 512x512 resolution
|
|
259
|
+
- Recommended: 1024x1024 or higher
|
|
260
|
+
- Format: JPEG or PNG
|
|
261
|
+
- Max size: 10MB
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## 📊 State Management
|
|
266
|
+
|
|
267
|
+
### Feature States
|
|
268
|
+
|
|
269
|
+
**isReady**: boolean
|
|
270
|
+
- Image selected and validated
|
|
271
|
+
- Check before enabling generate button
|
|
121
272
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
273
|
+
**isProcessing**: boolean
|
|
274
|
+
- Future generation in progress
|
|
275
|
+
- Show loading/progress indicator
|
|
276
|
+
- Disable generate button
|
|
277
|
+
|
|
278
|
+
**progress**: number (0-100)
|
|
279
|
+
- Generation progress percentage
|
|
280
|
+
- Update progress bar
|
|
281
|
+
|
|
282
|
+
**error**: string | null
|
|
283
|
+
- Error message if generation failed
|
|
284
|
+
- Common errors: "No person found in image", "Generation failed"
|
|
285
|
+
|
|
286
|
+
**result**: {
|
|
287
|
+
imageUrl: string
|
|
288
|
+
scenario?: string
|
|
289
|
+
age?: number
|
|
290
|
+
metadata?: any
|
|
128
291
|
}
|
|
129
|
-
```
|
|
130
292
|
|
|
131
|
-
|
|
293
|
+
---
|
|
132
294
|
|
|
133
|
-
|
|
295
|
+
## 🔐 Ethics & Privacy
|
|
134
296
|
|
|
135
|
-
|
|
297
|
+
### Consent Requirements
|
|
136
298
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
});
|
|
142
|
-
```
|
|
299
|
+
- **MUST** obtain explicit consent from subject
|
|
300
|
+
- **MUST** provide clear explanation of how images will be used
|
|
301
|
+
- **MUST** implement age verification
|
|
302
|
+
- **MUST** allow subjects to opt-out
|
|
143
303
|
|
|
144
|
-
###
|
|
304
|
+
### Content Moderation
|
|
145
305
|
|
|
146
|
-
|
|
306
|
+
- **MUST** filter inappropriate content
|
|
307
|
+
- **MUST** prevent malicious use cases
|
|
308
|
+
- **MUST** implement reporting mechanism
|
|
309
|
+
- **MUST** review flagged content
|
|
147
310
|
|
|
148
|
-
|
|
149
|
-
const result = await feature.process({
|
|
150
|
-
scenario: 'success',
|
|
151
|
-
});
|
|
152
|
-
```
|
|
311
|
+
### Usage Guidelines
|
|
153
312
|
|
|
154
|
-
|
|
313
|
+
- **MUST** provide terms of service
|
|
314
|
+
- **MUST** clearly label as AI-generated entertainment
|
|
315
|
+
- **MUST** include disclaimer about limitations
|
|
316
|
+
- **MUST** prevent medical accuracy claims
|
|
155
317
|
|
|
156
|
-
|
|
318
|
+
---
|
|
157
319
|
|
|
158
|
-
|
|
159
|
-
const result = await feature.process({
|
|
160
|
-
scenario: 'future-career',
|
|
161
|
-
});
|
|
162
|
-
```
|
|
320
|
+
## 🎨 Best Practices
|
|
163
321
|
|
|
164
|
-
###
|
|
322
|
+
### Photo Selection
|
|
165
323
|
|
|
166
|
-
|
|
324
|
+
1. **Photo Quality**
|
|
325
|
+
- Good: High-quality, well-lit photos
|
|
326
|
+
- Bad: Blurry, dark, low-resolution images
|
|
167
327
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
});
|
|
172
|
-
```
|
|
328
|
+
2. **Face Visibility**
|
|
329
|
+
- Good: Clear, frontal face shots
|
|
330
|
+
- Bad: Occluded or profile faces
|
|
173
331
|
|
|
174
|
-
|
|
332
|
+
3. **Lighting**
|
|
333
|
+
- Even lighting creates more natural results
|
|
334
|
+
- Front-facing well-lit photos ideal
|
|
175
335
|
|
|
176
|
-
|
|
177
|
-
2. Choose **Scenario** - Select the future scenario
|
|
178
|
-
3. Set **Age** (optional) - Target age for old age prediction
|
|
179
|
-
4. Tap **Generate** - Start the AI generation
|
|
180
|
-
5. View Result - See the future prediction
|
|
181
|
-
6. Save or Share - Save to gallery or share
|
|
336
|
+
### User Experience
|
|
182
337
|
|
|
183
|
-
|
|
338
|
+
1. **Clear UI**
|
|
339
|
+
- Show scenario examples
|
|
340
|
+
- Preview before processing
|
|
341
|
+
- Add confirmation dialog
|
|
184
342
|
|
|
185
|
-
|
|
343
|
+
2. **Error Handling**
|
|
344
|
+
- Explain "no person found" errors
|
|
345
|
+
- Provide troubleshooting tips
|
|
346
|
+
- Offer retry option
|
|
186
347
|
|
|
187
|
-
|
|
188
|
-
|
|
348
|
+
3. **Expectations**
|
|
349
|
+
- Results are AI-generated entertainment
|
|
350
|
+
- Not medically or scientifically accurate
|
|
351
|
+
- Provide clear disclaimers
|
|
189
352
|
|
|
190
|
-
|
|
191
|
-
{ id: 'old-age', name: 'Old Age', preview: '...' },
|
|
192
|
-
{ id: 'success', name: 'Success', preview: '...' },
|
|
193
|
-
{ id: 'future-career', name: 'Dream Career', preview: '...' },
|
|
194
|
-
{ id: 'future-family', name: 'Future Family', preview: '...' },
|
|
195
|
-
];
|
|
353
|
+
---
|
|
196
354
|
|
|
197
|
-
|
|
198
|
-
styles={scenarios}
|
|
199
|
-
selectedStyle={selectedScenario}
|
|
200
|
-
onSelectStyle={setSelectedScenario}
|
|
201
|
-
/>
|
|
202
|
-
```
|
|
355
|
+
## 🐛 Common Pitfalls
|
|
203
356
|
|
|
204
|
-
###
|
|
357
|
+
### Detection Issues
|
|
205
358
|
|
|
206
|
-
|
|
207
|
-
|
|
359
|
+
❌ **Problem**: "No person found" error
|
|
360
|
+
✅ **Solution**: Ensure person is clearly visible, well-lit, frontal
|
|
208
361
|
|
|
209
|
-
|
|
210
|
-
minimumValue={50}
|
|
211
|
-
maximumValue={100}
|
|
212
|
-
step={1}
|
|
213
|
-
value={age}
|
|
214
|
-
onValueChange={setAge}
|
|
215
|
-
/>
|
|
362
|
+
### Quality Issues
|
|
216
363
|
|
|
217
|
-
|
|
218
|
-
|
|
364
|
+
❌ **Problem**: Poor quality generation
|
|
365
|
+
✅ **Solution**: Use higher resolution images, better lighting
|
|
219
366
|
|
|
220
|
-
###
|
|
367
|
+
### Ethics Concerns
|
|
221
368
|
|
|
222
|
-
|
|
223
|
-
|
|
369
|
+
❌ **Problem**: Non-consensual image generation
|
|
370
|
+
✅ **Solution**: Implement consent mechanisms, age verification
|
|
224
371
|
|
|
225
|
-
|
|
226
|
-
<ResultImageCard
|
|
227
|
-
imageUrl={feature.state.result.imageUrl}
|
|
228
|
-
onSave={() => feature.saveResult()}
|
|
229
|
-
onShare={() => shareImage(feature.state.result.imageUrl)}
|
|
230
|
-
onRegenerate={() => feature.process()}
|
|
231
|
-
/>
|
|
232
|
-
)}
|
|
233
|
-
```
|
|
372
|
+
### Accuracy Issues
|
|
234
373
|
|
|
235
|
-
|
|
374
|
+
❌ **Problem**: Users expect accurate predictions
|
|
375
|
+
✅ **Solution**: Clear disclaimers about entertainment/limitations
|
|
236
376
|
|
|
237
|
-
|
|
238
|
-
2. **Face Visibility**: Ensure the face is clearly visible
|
|
239
|
-
3. **Forward Facing**: Forward-facing photos work best
|
|
240
|
-
4. **Good Lighting**: Even lighting creates more natural results
|
|
241
|
-
5. **Realistic Expectations**: Results are AI-generated predictions
|
|
377
|
+
---
|
|
242
378
|
|
|
243
|
-
##
|
|
379
|
+
## 📦 Related Components
|
|
244
380
|
|
|
245
|
-
|
|
381
|
+
Use these components from the library:
|
|
246
382
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
});
|
|
253
|
-
```
|
|
383
|
+
- **PhotoUploadCard**: Upload image interface
|
|
384
|
+
- **ScenarioSelector**: Choose future scenario
|
|
385
|
+
- **AgeSlider**: Set target age (for old-age)
|
|
386
|
+
- **ResultImageCard**: Display result with actions
|
|
387
|
+
- **ConfirmationDialog**: Confirm before processing
|
|
254
388
|
|
|
255
|
-
|
|
389
|
+
Located at: `src/presentation/components/`
|
|
256
390
|
|
|
257
|
-
|
|
258
|
-
// Share future predictions on social media
|
|
259
|
-
const result = await feature.process({
|
|
260
|
-
scenario: 'success',
|
|
261
|
-
});
|
|
262
|
-
```
|
|
391
|
+
---
|
|
263
392
|
|
|
264
|
-
|
|
393
|
+
## 🔄 Migration Strategy
|
|
265
394
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
395
|
+
If migrating from previous implementation:
|
|
396
|
+
|
|
397
|
+
1. **Update imports** to new path
|
|
398
|
+
2. **Add scenario selector**
|
|
399
|
+
3. **Implement age input** (for old-age)
|
|
400
|
+
4. **Add consent mechanism**
|
|
401
|
+
5. **Update state handling** for new structure
|
|
402
|
+
6. **Add disclaimer about limitations**
|
|
403
|
+
7. **Test all scenarios**
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
## ⚖️ Legal Considerations
|
|
408
|
+
|
|
409
|
+
### Compliance
|
|
410
|
+
|
|
411
|
+
- **Deepfake Regulations**: Comply with local laws
|
|
412
|
+
- **Privacy Laws**: GDPR, CCPA compliance
|
|
413
|
+
- **Consent Requirements**: Explicit permission needed
|
|
414
|
+
- **Age Restrictions**: Verify adult subjects
|
|
415
|
+
- **Content Labeling**: Mark as AI-generated
|
|
416
|
+
|
|
417
|
+
### Best Practices
|
|
418
|
+
|
|
419
|
+
- Provide attribution for source images
|
|
420
|
+
- Allow content reporting/flagging
|
|
421
|
+
- Implement audit trail logging
|
|
422
|
+
- Cooperate with takedown requests
|
|
423
|
+
- Include entertainment disclaimer
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
## 📚 Additional Resources
|
|
428
|
+
|
|
429
|
+
- Main documentation: `/docs/`
|
|
430
|
+
- API reference: `/docs/api/`
|
|
431
|
+
- Examples: `/docs/examples/basic/future-prediction/`
|
|
432
|
+
- Ethics guidelines: `/docs/ethics.md`
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
**Last Updated**: 2025-01-08
|
|
437
|
+
**Version**: 2.0.0 (Strategy-based Documentation)
|
|
272
438
|
|
|
273
|
-
|
|
439
|
+
---
|
|
274
440
|
|
|
275
|
-
|
|
276
|
-
- [AI Hug](../ai-hug) - Generate AI hug images
|
|
277
|
-
- [Face Swap](../face-swap) - Swap faces between images
|
|
441
|
+
## 📝 Changelog
|
|
278
442
|
|
|
279
|
-
|
|
443
|
+
### v2.0.0 - 2025-01-08
|
|
444
|
+
- **BREAKING**: Documentation format changed to strategy-based
|
|
445
|
+
- Removed extensive code examples
|
|
446
|
+
- Added ethics and privacy guidelines
|
|
447
|
+
- Added rules, prohibitions, and AI agent directions
|
|
448
|
+
- Focus on responsible AI usage
|
|
280
449
|
|
|
281
|
-
|
|
450
|
+
### v1.0.0 - Initial Release
|
|
451
|
+
- Initial feature documentation
|