open source alternative to viggle ai
- User
open source alternative to viggle ai
- Assistant
- User
build a colab notebook with a structure user like viggle ai with open source
- Assistant
- User
now make it to run with gradio with customized parametris
- Assistant
- User
add input video and the image to animate options
- Assistant
- User
this run correctly an generate a video in colab?
- Assistant
The code I provided earlier runs a that:
- User
yes
- Assistant
- User
HTTPError Traceback (most recent call last) in <cell line: 0>() 17 labels_path = "kinetics_labels.txt" 18 if not os.path.exists(labels_path): ---> 19 urllib.request.urlretrieve(labels_url, labels_path) 20 with open(labels_path, "r") as f: 21 kinetics_labels = [line.strip() for line in f.readlines()]
6 frames /usr/lib/python3.11/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs) 641 class HTTPDefaultErrorHandler(BaseHandler): 642 def http_error_default(self, req, fp, code, msg, hdrs): --> 643 raise HTTPError(req.full_url, code, msg, hdrs, fp) 644 645 class HTTPRedirectHandler(BaseHandler):
HTTPError: HTTP Error 404: Not Found
- Assistant
The error indicates that the URL:
https://raw.githubusercontent.com/deepmind/kinetics-i3d/master/label_map.txtreturns a 404 Not Found, so the labels file isn't reachable anymore.
Fix:
The official
kinetics_labels.txtfile URL has changed or isn't hosted there anymore.The PyTorchVideo repo has a kinetics400 labels file, let’s use that URL instead:
labels_url = "https://raw.githubusercontent.com/facebookresearch/pytorchvideo/main/pytorchvideo/data/kinetics/labels.txt"This is a valid link to the kinetics-400 labels as of now.
So update this part in the code to:
import urllib import os labels_url = "https://raw.githubusercontent.com/facebookresearch/pytorchvideo/main/pytorchvideo/data/kinetics/labels.txt" labels_path = "kinetics_labels.txt" if not os.path.exists(labels_path): urllib.request.urlretrieve(labels_url, labels_path) with open(labels_path, "r") as f: kinetics_labels = [line.strip() for line in f.readlines()] - User
this url is for load video file?
- Assistant
No, that URL is not for loading a video file.
It is the text file containing the list of action class labels (the "kinetics labels") that correspond to the output classes of the action recognition model.
Clarification:
-
The URL
https://raw.githubusercontent.com/facebookresearch/pytorchvideo/main/pytorchvideo/data/kinetics/labels.txt
provides a.txtfile listing the 400 class names of the Kinetics-400 dataset. -
This file is used to map the model's output indices (0–399) to human-readable action labels (e.g., "abseiling", "playing guitar", "drinking beer", etc).
-
- User
AttributeError Traceback (most recent call last) in <cell line: 0>() 189 iface.launch(share=True) 190 --> 191 iface.set_event_trigger( 192 "input_type", 193 toggle_inputs,
AttributeError: 'Interface' object has no attribute 'set_event_trigger'
- Assistant
- User
Colab notebook detected. To show errors in colab notebook, set debug=True in launch()
- Running on public URL: https://16b8a29fcce4d5767d.gradio.live
This share link expires in 1 week. For free permanent hosting and GPU upgrades, run
gradio deployfrom the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces) - Assistant
This message is normal and expected when you launch a Gradio app in Colab:
Colab notebook detected. To show errors in colab notebook, set debug=True in launch() * Running on public URL: https://16b8a29fcce4d5767d.gradio.live This share link expires in 1 week. For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)
Explanation:
- Gradio detects your environment is Colab, so it automatically creates a public temporary sharing link.
- This link is accessible for about 7 days, allowing others to access your app.
debug=Trueflag inlaunch()shows errors and printouts inside Colab output cells, helpful for troubleshooting.
- User
no aprears image upload
- Assistant
- User
Colab notebook detected. To show errors in colab notebook, set debug=True in launch()
- Running on public URL: https://46678159904ac51a07.gradio.live
This share link expires in 1 week. For free permanent hosting and GPU upgrades, run
gradio deployfrom the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces) - Assistant
The message you're seeing:
Colab notebook detected. To show errors in colab notebook, set debug=True in launch() * Running on public URL: https://46678159904ac51a07.gradio.live This share link expires in 1 week. For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces) - User
error: no interface running right now
- Assistant
The message “no interface running right now” usually occurs if you try to access a Gradio share link after the Colab session has ended, or if your Gradio app was never successfully launched or has already stopped running.
Here are the common reasons and how to fix them:
Common Causes and Solutions
-
Colab session disconnected/restarted
-
- User
- Assistant
- User
error and the cell not continue running
- Assistant
- User
('Input type: Image', None)
- Assistant
The output
('Input type: Image', None)is from the dummy example I gave where the prediction function just returns a tuple of a string andNone.
What’s happening?
In the dummy function:
def dummy_predict(input_type, video_file, image_file, clip_duration, num_frames): return f"Input type: {input_type}", None- It returns a string for the first output component (a textbox).
- Returns
Nonefor the second output component.
That’s why you see:
- User
- Assistant
- User
Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/gradio/queueing.py", line 625, in process_events response = await route_utils.call_process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/route_utils.py", line 322, in call_process_api output = await app.get_blocks().process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/blocks.py", line 2146, in process_api result = await self.call_function( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/blocks.py", line 1664, in call_function prediction = await anyio.to_thread.run_sync( # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 967, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/utils.py", line 884, in wrapper response = f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "", line 119, in model_inference frames, top5_results = process_image(image_file.name, num_frames) ^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'name'
- Assistant
The error message:
AttributeError: 'str' object has no attribute 'name'happens because in your
model_inferencefunction, you do:frames, top5_results = process_image(image_file.name, num_frames) - User
- Assistant
Certainly! The only necessary fix is to remove
.namewhen accessing the file paths fromvideo_fileandimage_file, since Gradio returns file paths as strings for these input components (especially whentype="filepath"is used).So change this part of your
model_inferencefunction:# Old (incorrect): frames, top5_results = process_video(video_file.name, clip_duration, num_frames) # Correct: frames, top5_results = process_video(video_file, clip_duration, num_frames) # Old (incorrect): frames, top5_results = process_image(image_file.name, num_frames) # Correct: frames, top5_results = process_image(image_file, num_frames) - User
Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/gradio/queueing.py", line 625, in process_events response = await route_utils.call_process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/route_utils.py", line 322, in call_process_api output = await app.get_blocks().process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/blocks.py", line 2146, in process_api result = await self.call_function( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/blocks.py", line 1664, in call_function prediction = await anyio.to_thread.run_sync( # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 967, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/utils.py", line 884, in wrapper response = f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "", line 118, in model_inference frames, top5_results = process_image(image_file, num_frames) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 106, in process_image top5_results = [(kinetics_labels[idx], float(prob)) for prob, idx in zip(top5_prob, top5_catid)] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 106, in top5_results = [(kinetics_labels[idx], float(prob)) for prob, idx in zip(top5_prob, top5_catid)] ~~~~~~~~~~~~~~~^^^^^ IndexError: list index out of range
- Assistant
- User
Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/gradio/queueing.py", line 625, in process_events response = await route_utils.call_process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/route_utils.py", line 322, in call_process_api output = await app.get_blocks().process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/blocks.py", line 2156, in process_api data = await self.postprocess_data(block_fn, result["prediction"], state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/blocks.py", line 1940, in postprocess_data prediction_value = block.postprocess(prediction_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/gradio/components/label.py", line 146, in postprocess confidences=[ ^ File "/usr/local/lib/python3.11/dist-packages/gradio/components/label.py", line 147, in LabelConfidence(label=pred[0], confidence=pred[1]) File "/usr/local/lib/python3.11/dist-packages/pydantic/main.py", line 253, in validated_self = self..validate_python(data, self_instance=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pydantic_core._pydantic_core.ValidationError: 1 validation error for LabelConfidence confidence Input should be a valid number, unable to parse string as a number [type=float_parsing, input_value='0.3%', input_type=str] For further information visit
- Assistant
The error message:
ValidationError: Input should be a valid number, unable to parse string as a number [type=float_parsing, input_value='0.3%', input_type=str] - User
the complete code only make a zoom in video. construct a code for use a pose of a video file using this pose of this video in a image uploaded like viggle dance video
- Assistant
- User
error Traceback (most recent call last) in <cell line: 0>() 33 image_path = "image.jpg" # Replace with your image path 34 image = cv2.imread(image_path) ---> 35 keypoints_image = extract_pose_keypoints(image) 36 37 if keypoints_image:
in extract_pose_keypoints(image) 9 def extract_pose_keypoints(image): 10 # image is a numpy array (BGR format) ---> 11 image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) 12 results = pose.process(image_rgb) 13 keypoints = []
error: OpenCV(4.11.0) /io/opencv/modules/imgproc/src/color.cpp:199: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
- Assistant
- User
freepik__a-cute-cartoon-baby-of-caucasian-descent-wearing-a__43519.jpeg freepik__a-cute-cartoon-baby-of-caucasian-descent-wearing-a__43519.jpeg(image/jpeg) - 322939 bytes, last modified: 27/03/2025 - 100% done Saving freepik__a-cute-cartoon-baby-of-caucasian-descent-wearing-a__43519.jpeg to freepik__a-cute-cartoon-baby-of-caucasian-descent-wearing-a__43519 (1).jpeg Uploaded file: freepik__a-cute-cartoon-baby-of-caucasian-descent-wearing-a__43519 (1).jpeg
AttributeError Traceback (most recent call last) in <cell line: 0>() 50 51 if keypoints_image: ---> 52 annotated_image = draw_pose_landmarks(image, keypoints_image) 53 plt.figure(figsize=(8,8)) 54 plt.imshow(cv2.cvtColor(annotated_image, cv2.COLOR_BGR2RGB))
1 frames in (.0) 38 landmark_list = landmark_pb2.NormalizedLandmarkList( 39 landmark=[ ---> 40 mp.framework.formats.landmark_pb2.NormalizedLandmark( 41 x=k[0], y=k[1], z=k[2], visibility=k[3]) for k in keypoints 42 ])
AttributeError: module 'mediapipe' has no attribute 'framework'
- Assistant
The error:
- User
an make to extract pose of a video file and use this pose in a image file
- Assistant
- User
ModuleNotFoundError Traceback (most recent call last) in <cell line: 0>() 12 import warnings 13 from base64 import b64encode ---> 14 from demo import load_checkpoints, make_animation # type: ignore (local file) 15 from google.colab import files, output 16 from IPython.display import HTML, Javascript
10 frames /usr/local/lib/python3.11/dist-packages/numpy/init.py in getattr(attr) 374 _sanity_check() 375 del _sanity_check --> 376 377 def _mac_os_check(): 378 """
ModuleNotFoundError: No module named 'numpy.strings'
NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the "Open Examples" button below.
- Assistant
The error:
ModuleNotFoundError: No module named 'numpy.strings'typically occurs when running code or imports that assume an older version of numpy or some deprecated internal numpy module (
numpy.stringsdoesn’t exist in recent versions).
What’s going on?
- The First Order Motion Model (FOMM) and similar repos sometimes rely on older numpy internals or dependencies.
- Your environment likely has a newer numpy version incompatible with their code.